<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html xmlns:yui="http://yuilibrary.com/rdf/1.0/yui.rdf#">
<head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
	<title>API: button   button.js  (YUI Library)</title>

	<link rel="stylesheet" type="text/css" href="assets/reset-fonts-grids-min.css" />
	<link rel="stylesheet" type="text/css" href="assets/api.css" />

    <script type="text/javascript" src="assets/api-js"></script>
    <script type="text/javascript" src="assets/ac-js"></script>
</head>

<body id="yahoo-com">

<div id="doc3" class="yui-t2">
	<div id="hd">
        <h1><a href="http://developer.yahoo.com/yui/" title="Yahoo! UI Library">Yahoo! UI Library</a></h1>
        <h3>Button&nbsp; <span class="subtitle">2.9.0</span></h3>
        <a href="./index.html" title="Yahoo! UI Library">Yahoo! UI Library</a> 
            &gt; <a href="./module_button.html" title="button">button</a>
                
                 &gt; button.js (source view) 
        <form onsubmit="return false">
            <div id="propertysearch">
                Search: <input autocomplete="off" id="searchinput" />
                <div id="searchresults">
                    &nbsp;
                </div>
            </div>
        </form>
	</div>

	<div id="bd">
		<div id="yui-main">
			<div class="yui-b">
            <form action="#" name="yui-classopts-form" method="get" id="yui-classopts-form">
                <fieldset>
                    <legend>Filters</legend>
                <span class="classopts"><input type="checkbox" name="show_private" id="show_private" /> <label for="show_private">Show Private</label></span>
                <span class="classopts"><input type="checkbox" name="show_protected" id="show_protected" /> <label for="show_protected">Show Protected</label></span>
                <span class="classopts"><input type="checkbox" name="show_deprecated" id="show_deprecated" /> <label for="show_deprecated">Show Deprecated</label></span>
                </fieldset>
            </form>

                    <div id="srcout">
                        <style>
                            #doc3 .classopts { display:none; }
                        </style>
                        <div class="highlight"><pre><span class="cm">/**</span>
<span class="cm">* @module button</span>
<span class="cm">* @description &lt;p&gt;The Button Control enables the creation of rich, graphical </span>
<span class="cm">* buttons that function like traditional HTML form buttons.  &lt;em&gt;Unlike&lt;/em&gt; </span>
<span class="cm">* traditional HTML form buttons, buttons created with the Button Control can have </span>
<span class="cm">* a label that is different from its value.  With the inclusion of the optional </span>
<span class="cm">* &lt;a href=&quot;module_menu.html&quot;&gt;Menu Control&lt;/a&gt;, the Button Control can also be</span>
<span class="cm">* used to create menu buttons and split buttons, controls that are not </span>
<span class="cm">* available natively in HTML.  The Button Control can also be thought of as a </span>
<span class="cm">* way to create more visually engaging implementations of the browser&#39;s </span>
<span class="cm">* default radio-button and check-box controls.&lt;/p&gt;</span>
<span class="cm">* &lt;p&gt;The Button Control supports the following types:&lt;/p&gt;</span>
<span class="cm">* &lt;dl&gt;</span>
<span class="cm">* &lt;dt&gt;push&lt;/dt&gt;</span>
<span class="cm">* &lt;dd&gt;Basic push button that can execute a user-specified command when </span>
<span class="cm">* pressed.&lt;/dd&gt;</span>
<span class="cm">* &lt;dt&gt;link&lt;/dt&gt;</span>
<span class="cm">* &lt;dd&gt;Navigates to a specified url when pressed.&lt;/dd&gt;</span>
<span class="cm">* &lt;dt&gt;submit&lt;/dt&gt;</span>
<span class="cm">* &lt;dd&gt;Submits the parent form when pressed.&lt;/dd&gt;</span>
<span class="cm">* &lt;dt&gt;reset&lt;/dt&gt;</span>
<span class="cm">* &lt;dd&gt;Resets the parent form when pressed.&lt;/dd&gt;</span>
<span class="cm">* &lt;dt&gt;checkbox&lt;/dt&gt;</span>
<span class="cm">* &lt;dd&gt;Maintains a &quot;checked&quot; state that can be toggled on and off.&lt;/dd&gt;</span>
<span class="cm">* &lt;dt&gt;radio&lt;/dt&gt;</span>
<span class="cm">* &lt;dd&gt;Maintains a &quot;checked&quot; state that can be toggled on and off.  Use with </span>
<span class="cm">* the ButtonGroup class to create a set of controls that are mutually </span>
<span class="cm">* exclusive; checking one button in the set will uncheck all others in </span>
<span class="cm">* the group.&lt;/dd&gt;</span>
<span class="cm">* &lt;dt&gt;menu&lt;/dt&gt;</span>
<span class="cm">* &lt;dd&gt;When pressed will show/hide a menu.&lt;/dd&gt;</span>
<span class="cm">* &lt;dt&gt;split&lt;/dt&gt;</span>
<span class="cm">* &lt;dd&gt;Can execute a user-specified command or display a menu when pressed.&lt;/dd&gt;</span>
<span class="cm">* &lt;/dl&gt;</span>
<span class="cm">* @title Button</span>
<span class="cm">* @namespace YAHOO.widget</span>
<span class="cm">* @requires yahoo, dom, element, event</span>
<span class="cm">* @optional container, menu</span>
<span class="cm">*/</span>


<span class="p">(</span><span class="kd">function</span> <span class="p">()</span> <span class="p">{</span>


    <span class="cm">/**</span>
<span class="cm">    * The Button class creates a rich, graphical button.</span>
<span class="cm">    * @param {String} p_oElement String specifying the id attribute of the </span>
<span class="cm">    * &lt;code&gt;&amp;#60;input&amp;#62;&lt;/code&gt;, &lt;code&gt;&amp;#60;button&amp;#62;&lt;/code&gt;,</span>
<span class="cm">    * &lt;code&gt;&amp;#60;a&amp;#62;&lt;/code&gt;, or &lt;code&gt;&amp;#60;span&amp;#62;&lt;/code&gt; element to </span>
<span class="cm">    * be used to create the button.</span>
<span class="cm">    * @param {&lt;a href=&quot;http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-</span>
<span class="cm">    * one-html.html#ID-6043025&quot;&gt;HTMLInputElement&lt;/a&gt;|&lt;a href=&quot;http://www.w3.org</span>
<span class="cm">    * /TR/2000/WD-DOM-Level-1-20000929/level-one-html.html#ID-34812697&quot;&gt;</span>
<span class="cm">    * HTMLButtonElement&lt;/a&gt;|&lt;a href=&quot;</span>
<span class="cm">    * http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-html.html#</span>
<span class="cm">    * ID-33759296&quot;&gt;HTMLElement&lt;/a&gt;} p_oElement Object reference for the </span>
<span class="cm">    * &lt;code&gt;&amp;#60;input&amp;#62;&lt;/code&gt;, &lt;code&gt;&amp;#60;button&amp;#62;&lt;/code&gt;, </span>
<span class="cm">    * &lt;code&gt;&amp;#60;a&amp;#62;&lt;/code&gt;, or &lt;code&gt;&amp;#60;span&amp;#62;&lt;/code&gt; element to be </span>
<span class="cm">    * used to create the button.</span>
<span class="cm">    * @param {Object} p_oElement Object literal specifying a set of   </span>
<span class="cm">    * configuration attributes used to create the button.</span>
<span class="cm">    * @param {Object} p_oAttributes Optional. Object literal specifying a set  </span>
<span class="cm">    * of configuration attributes used to create the button.</span>
<span class="cm">    * @namespace YAHOO.widget</span>
<span class="cm">    * @class Button</span>
<span class="cm">    * @constructor</span>
<span class="cm">    * @extends YAHOO.util.Element</span>
<span class="cm">    */</span>



    <span class="c1">// Shorthard for utilities</span>

    <span class="kd">var</span> <span class="nx">Dom</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">Dom</span><span class="p">,</span>
        <span class="nx">Event</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">Event</span><span class="p">,</span>
        <span class="nx">Lang</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">lang</span><span class="p">,</span>
        <span class="nx">UA</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">env</span><span class="p">.</span><span class="nx">ua</span><span class="p">,</span>
        <span class="nx">Overlay</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">widget</span><span class="p">.</span><span class="nx">Overlay</span><span class="p">,</span>
        <span class="nx">Menu</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">widget</span><span class="p">.</span><span class="nx">Menu</span><span class="p">,</span>
    
    
        <span class="c1">// Private member variables</span>
    
        <span class="nx">m_oButtons</span> <span class="o">=</span> <span class="p">{},</span>    <span class="c1">// Collection of all Button instances</span>
        <span class="nx">m_oOverlayManager</span> <span class="o">=</span> <span class="kc">null</span><span class="p">,</span>   <span class="c1">// YAHOO.widget.OverlayManager instance</span>
        <span class="nx">m_oSubmitTrigger</span> <span class="o">=</span> <span class="kc">null</span><span class="p">,</span>    <span class="c1">// The button that submitted the form </span>
        <span class="nx">m_oFocusedButton</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>    <span class="c1">// The button that has focus</span>



    <span class="c1">// Private methods</span>

    
    
    <span class="cm">/**</span>
<span class="cm">    * @method createInputElement</span>
<span class="cm">    * @description Creates an &lt;code&gt;&amp;#60;input&amp;#62;&lt;/code&gt; element of the </span>
<span class="cm">    * specified type.</span>
<span class="cm">    * @private</span>
<span class="cm">    * @param {String} p_sType String specifying the type of </span>
<span class="cm">    * &lt;code&gt;&amp;#60;input&amp;#62;&lt;/code&gt; element to create.</span>
<span class="cm">    * @param {String} p_sName String specifying the name of </span>
<span class="cm">    * &lt;code&gt;&amp;#60;input&amp;#62;&lt;/code&gt; element to create.</span>
<span class="cm">    * @param {String} p_sValue String specifying the value of </span>
<span class="cm">    * &lt;code&gt;&amp;#60;input&amp;#62;&lt;/code&gt; element to create.</span>
<span class="cm">    * @param {String} p_bChecked Boolean specifying if the  </span>
<span class="cm">    * &lt;code&gt;&amp;#60;input&amp;#62;&lt;/code&gt; element is to be checked.</span>
<span class="cm">    * @return {&lt;a href=&quot;http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-</span>
<span class="cm">    * one-html.html#ID-6043025&quot;&gt;HTMLInputElement&lt;/a&gt;}</span>
<span class="cm">    */</span>
    <span class="kd">function</span> <span class="nx">createInputElement</span><span class="p">(</span><span class="nx">p_sType</span><span class="p">,</span> <span class="nx">p_sName</span><span class="p">,</span> <span class="nx">p_sValue</span><span class="p">,</span> <span class="nx">p_bChecked</span><span class="p">)</span> <span class="p">{</span>
    
        <span class="kd">var</span> <span class="nx">oInput</span><span class="p">,</span>
            <span class="nx">sInput</span><span class="p">;</span>
    
        <span class="k">if</span> <span class="p">(</span><span class="nx">Lang</span><span class="p">.</span><span class="nx">isString</span><span class="p">(</span><span class="nx">p_sType</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="nx">Lang</span><span class="p">.</span><span class="nx">isString</span><span class="p">(</span><span class="nx">p_sName</span><span class="p">))</span> <span class="p">{</span>
        
            <span class="k">if</span> <span class="p">(</span><span class="nx">UA</span><span class="p">.</span><span class="nx">ie</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">UA</span><span class="p">.</span><span class="nx">ie</span> <span class="o">&lt;</span> <span class="mi">9</span><span class="p">))</span> <span class="p">{</span>
        
                <span class="cm">/*</span>
<span class="cm">                    For IE it is necessary to create the element with the </span>
<span class="cm">                    &quot;type,&quot; &quot;name,&quot; &quot;value,&quot; and &quot;checked&quot; properties set all </span>
<span class="cm">                    at once.</span>
<span class="cm">                */</span>
            
                <span class="nx">sInput</span> <span class="o">=</span> <span class="s2">&quot;&lt;input type=\&quot;&quot;</span> <span class="o">+</span> <span class="nx">p_sType</span> <span class="o">+</span> <span class="s2">&quot;\&quot; name=\&quot;&quot;</span> <span class="o">+</span> 
                    <span class="nx">p_sName</span> <span class="o">+</span> <span class="s2">&quot;\&quot;&quot;</span><span class="p">;</span>
        
                <span class="k">if</span> <span class="p">(</span><span class="nx">p_bChecked</span><span class="p">)</span> <span class="p">{</span>
        
                    <span class="nx">sInput</span> <span class="o">+=</span> <span class="s2">&quot; checked&quot;</span><span class="p">;</span>
                
                <span class="p">}</span>
                
                <span class="nx">sInput</span> <span class="o">+=</span> <span class="s2">&quot;&gt;&quot;</span><span class="p">;</span>
        
                <span class="nx">oInput</span> <span class="o">=</span> <span class="nb">document</span><span class="p">.</span><span class="nx">createElement</span><span class="p">(</span><span class="nx">sInput</span><span class="p">);</span>
        
                <span class="nx">oInput</span><span class="p">.</span><span class="nx">value</span> <span class="o">=</span> <span class="nx">p_sValue</span><span class="p">;</span>

            <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
            
                <span class="nx">oInput</span> <span class="o">=</span> <span class="nb">document</span><span class="p">.</span><span class="nx">createElement</span><span class="p">(</span><span class="s2">&quot;input&quot;</span><span class="p">);</span>
                <span class="nx">oInput</span><span class="p">.</span><span class="nx">name</span> <span class="o">=</span> <span class="nx">p_sName</span><span class="p">;</span>
                <span class="nx">oInput</span><span class="p">.</span><span class="nx">type</span> <span class="o">=</span> <span class="nx">p_sType</span><span class="p">;</span>
                <span class="nx">oInput</span><span class="p">.</span><span class="nx">value</span> <span class="o">=</span> <span class="nx">p_sValue</span><span class="p">;</span>
        
                <span class="k">if</span> <span class="p">(</span><span class="nx">p_bChecked</span><span class="p">)</span> <span class="p">{</span>
        
                    <span class="nx">oInput</span><span class="p">.</span><span class="nx">checked</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
                
                <span class="p">}</span>
        
            <span class="p">}</span>
        
        
        <span class="p">}</span>

		<span class="k">return</span> <span class="nx">oInput</span><span class="p">;</span>
    
    <span class="p">}</span>
    
    
    <span class="cm">/**</span>
<span class="cm">    * @method setAttributesFromSrcElement</span>
<span class="cm">    * @description Gets the values for all the attributes of the source element </span>
<span class="cm">    * (either &lt;code&gt;&amp;#60;input&amp;#62;&lt;/code&gt; or &lt;code&gt;&amp;#60;a&amp;#62;&lt;/code&gt;) that </span>
<span class="cm">    * map to Button configuration attributes and sets them into a collection </span>
<span class="cm">    * that is passed to the Button constructor.</span>
<span class="cm">    * @private</span>
<span class="cm">    * @param {&lt;a href=&quot;http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-</span>
<span class="cm">    * one-html.html#ID-6043025&quot;&gt;HTMLInputElement&lt;/a&gt;|&lt;a href=&quot;http://www.w3.org/</span>
<span class="cm">    * TR/2000/WD-DOM-Level-1-20000929/level-one-html.html#ID-</span>
<span class="cm">    * 48250443&quot;&gt;HTMLAnchorElement&lt;/a&gt;} p_oElement Object reference to the HTML </span>
<span class="cm">    * element (either &lt;code&gt;&amp;#60;input&amp;#62;&lt;/code&gt; or &lt;code&gt;&amp;#60;span&amp;#62;</span>
<span class="cm">    * &lt;/code&gt;) used to create the button.</span>
<span class="cm">    * @param {Object} p_oAttributes Object reference for the collection of </span>
<span class="cm">    * configuration attributes used to create the button.</span>
<span class="cm">    */</span>
    <span class="kd">function</span> <span class="nx">setAttributesFromSrcElement</span><span class="p">(</span><span class="nx">p_oElement</span><span class="p">,</span> <span class="nx">p_oAttributes</span><span class="p">)</span> <span class="p">{</span>
    
        <span class="kd">var</span> <span class="nx">sSrcElementNodeName</span> <span class="o">=</span> <span class="nx">p_oElement</span><span class="p">.</span><span class="nx">nodeName</span><span class="p">.</span><span class="nx">toUpperCase</span><span class="p">(),</span>
			<span class="nx">sClass</span> <span class="o">=</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">CLASS_NAME_PREFIX</span> <span class="o">+</span> <span class="k">this</span><span class="p">.</span><span class="nx">CSS_CLASS_NAME</span><span class="p">),</span>
            <span class="nx">me</span> <span class="o">=</span> <span class="k">this</span><span class="p">,</span>
            <span class="nx">oAttribute</span><span class="p">,</span>
            <span class="nx">oRootNode</span><span class="p">,</span>
            <span class="nx">sText</span><span class="p">;</span>
            
    
        <span class="cm">/**</span>
<span class="cm">        * @method setAttributeFromDOMAttribute</span>
<span class="cm">        * @description Gets the value of the specified DOM attribute and sets it </span>
<span class="cm">        * into the collection of configuration attributes used to configure </span>
<span class="cm">        * the button.</span>
<span class="cm">        * @private</span>
<span class="cm">        * @param {String} p_sAttribute String representing the name of the </span>
<span class="cm">        * attribute to retrieve from the DOM element.</span>
<span class="cm">        */</span>
        <span class="kd">function</span> <span class="nx">setAttributeFromDOMAttribute</span><span class="p">(</span><span class="nx">p_sAttribute</span><span class="p">)</span> <span class="p">{</span>
    
            <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="p">(</span><span class="nx">p_sAttribute</span> <span class="k">in</span> <span class="nx">p_oAttributes</span><span class="p">))</span> <span class="p">{</span>
    
                <span class="cm">/*</span>
<span class="cm">                    Need to use &quot;getAttributeNode&quot; instead of &quot;getAttribute&quot; </span>
<span class="cm">                    because using &quot;getAttribute,&quot; IE will return the innerText </span>
<span class="cm">                    of a &lt;code&gt;&amp;#60;button&amp;#62;&lt;/code&gt; for the value attribute  </span>
<span class="cm">                    rather than the value of the &quot;value&quot; attribute.</span>
<span class="cm">                */</span>
        
                <span class="nx">oAttribute</span> <span class="o">=</span> <span class="nx">p_oElement</span><span class="p">.</span><span class="nx">getAttributeNode</span><span class="p">(</span><span class="nx">p_sAttribute</span><span class="p">);</span>
        
    
                <span class="k">if</span> <span class="p">(</span><span class="nx">oAttribute</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="s2">&quot;value&quot;</span> <span class="k">in</span> <span class="nx">oAttribute</span><span class="p">))</span> <span class="p">{</span>
    
                    <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Setting attribute \&quot;&quot;</span> <span class="o">+</span> <span class="nx">p_sAttribute</span> <span class="o">+</span> 
                        <span class="s2">&quot;\&quot; using source element&#39;s attribute value of \&quot;&quot;</span> <span class="o">+</span> 
                        <span class="nx">oAttribute</span><span class="p">.</span><span class="nx">value</span> <span class="o">+</span> <span class="s2">&quot;\&quot;&quot;</span><span class="p">,</span> <span class="s2">&quot;info&quot;</span><span class="p">,</span> <span class="nx">me</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
    
                    <span class="nx">p_oAttributes</span><span class="p">[</span><span class="nx">p_sAttribute</span><span class="p">]</span> <span class="o">=</span> <span class="nx">oAttribute</span><span class="p">.</span><span class="nx">value</span><span class="p">;</span>
    
                <span class="p">}</span>
    
            <span class="p">}</span>
        
        <span class="p">}</span>
    
    
        <span class="cm">/**</span>
<span class="cm">        * @method setFormElementProperties</span>
<span class="cm">        * @description Gets the value of the attributes from the form element  </span>
<span class="cm">        * and sets them into the collection of configuration attributes used to </span>
<span class="cm">        * configure the button.</span>
<span class="cm">        * @private</span>
<span class="cm">        */</span>
        <span class="kd">function</span> <span class="nx">setFormElementProperties</span><span class="p">()</span> <span class="p">{</span>
    
            <span class="nx">setAttributeFromDOMAttribute</span><span class="p">(</span><span class="s2">&quot;type&quot;</span><span class="p">);</span>
    
            <span class="k">if</span> <span class="p">(</span><span class="nx">p_oAttributes</span><span class="p">.</span><span class="nx">type</span> <span class="o">==</span> <span class="s2">&quot;button&quot;</span><span class="p">)</span> <span class="p">{</span>
            
                <span class="nx">p_oAttributes</span><span class="p">.</span><span class="nx">type</span> <span class="o">=</span> <span class="s2">&quot;push&quot;</span><span class="p">;</span>
            
            <span class="p">}</span>
    
            <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="p">(</span><span class="s2">&quot;disabled&quot;</span> <span class="k">in</span> <span class="nx">p_oAttributes</span><span class="p">))</span> <span class="p">{</span>
    
                <span class="nx">p_oAttributes</span><span class="p">.</span><span class="nx">disabled</span> <span class="o">=</span> <span class="nx">p_oElement</span><span class="p">.</span><span class="nx">disabled</span><span class="p">;</span>
    
            <span class="p">}</span>
    
            <span class="nx">setAttributeFromDOMAttribute</span><span class="p">(</span><span class="s2">&quot;name&quot;</span><span class="p">);</span>
            <span class="nx">setAttributeFromDOMAttribute</span><span class="p">(</span><span class="s2">&quot;value&quot;</span><span class="p">);</span>
            <span class="nx">setAttributeFromDOMAttribute</span><span class="p">(</span><span class="s2">&quot;title&quot;</span><span class="p">);</span>
    
        <span class="p">}</span>

    
        <span class="k">switch</span> <span class="p">(</span><span class="nx">sSrcElementNodeName</span><span class="p">)</span> <span class="p">{</span>
        
        <span class="k">case</span> <span class="s2">&quot;A&quot;</span><span class="o">:</span>
            
            <span class="nx">p_oAttributes</span><span class="p">.</span><span class="nx">type</span> <span class="o">=</span> <span class="s2">&quot;link&quot;</span><span class="p">;</span>
            
            <span class="nx">setAttributeFromDOMAttribute</span><span class="p">(</span><span class="s2">&quot;href&quot;</span><span class="p">);</span>
            <span class="nx">setAttributeFromDOMAttribute</span><span class="p">(</span><span class="s2">&quot;target&quot;</span><span class="p">);</span>
        
            <span class="k">break</span><span class="p">;</span>
    
        <span class="k">case</span> <span class="s2">&quot;INPUT&quot;</span><span class="o">:</span>

            <span class="nx">setFormElementProperties</span><span class="p">();</span>

            <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="p">(</span><span class="s2">&quot;checked&quot;</span> <span class="k">in</span> <span class="nx">p_oAttributes</span><span class="p">))</span> <span class="p">{</span>
    
                <span class="nx">p_oAttributes</span><span class="p">.</span><span class="nx">checked</span> <span class="o">=</span> <span class="nx">p_oElement</span><span class="p">.</span><span class="nx">checked</span><span class="p">;</span>
    
            <span class="p">}</span>

            <span class="k">break</span><span class="p">;</span>

        <span class="k">case</span> <span class="s2">&quot;BUTTON&quot;</span><span class="o">:</span>

            <span class="nx">setFormElementProperties</span><span class="p">();</span>

            <span class="nx">oRootNode</span> <span class="o">=</span> <span class="nx">p_oElement</span><span class="p">.</span><span class="nx">parentNode</span><span class="p">.</span><span class="nx">parentNode</span><span class="p">;</span>

            <span class="k">if</span> <span class="p">(</span><span class="nx">Dom</span><span class="p">.</span><span class="nx">hasClass</span><span class="p">(</span><span class="nx">oRootNode</span><span class="p">,</span> <span class="nx">sClass</span> <span class="o">+</span> <span class="s2">&quot;-checked&quot;</span><span class="p">))</span> <span class="p">{</span>
            
                <span class="nx">p_oAttributes</span><span class="p">.</span><span class="nx">checked</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
            
            <span class="p">}</span>

            <span class="k">if</span> <span class="p">(</span><span class="nx">Dom</span><span class="p">.</span><span class="nx">hasClass</span><span class="p">(</span><span class="nx">oRootNode</span><span class="p">,</span> <span class="nx">sClass</span> <span class="o">+</span> <span class="s2">&quot;-disabled&quot;</span><span class="p">))</span> <span class="p">{</span>

                <span class="nx">p_oAttributes</span><span class="p">.</span><span class="nx">disabled</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
            
            <span class="p">}</span>

            <span class="nx">p_oElement</span><span class="p">.</span><span class="nx">removeAttribute</span><span class="p">(</span><span class="s2">&quot;value&quot;</span><span class="p">);</span>

            <span class="nx">p_oElement</span><span class="p">.</span><span class="nx">setAttribute</span><span class="p">(</span><span class="s2">&quot;type&quot;</span><span class="p">,</span> <span class="s2">&quot;button&quot;</span><span class="p">);</span>

            <span class="k">break</span><span class="p">;</span>
        
        <span class="p">}</span>

        <span class="nx">p_oElement</span><span class="p">.</span><span class="nx">removeAttribute</span><span class="p">(</span><span class="s2">&quot;id&quot;</span><span class="p">);</span>
        <span class="nx">p_oElement</span><span class="p">.</span><span class="nx">removeAttribute</span><span class="p">(</span><span class="s2">&quot;name&quot;</span><span class="p">);</span>
        
        <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="p">(</span><span class="s2">&quot;tabindex&quot;</span> <span class="k">in</span> <span class="nx">p_oAttributes</span><span class="p">))</span> <span class="p">{</span>

            <span class="nx">p_oAttributes</span><span class="p">.</span><span class="nx">tabindex</span> <span class="o">=</span> <span class="nx">p_oElement</span><span class="p">.</span><span class="nx">tabIndex</span><span class="p">;</span>

        <span class="p">}</span>
    
        <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="p">(</span><span class="s2">&quot;label&quot;</span> <span class="k">in</span> <span class="nx">p_oAttributes</span><span class="p">))</span> <span class="p">{</span>
    
            <span class="c1">// Set the &quot;label&quot; property</span>
        
            <span class="nx">sText</span> <span class="o">=</span> <span class="nx">sSrcElementNodeName</span> <span class="o">==</span> <span class="s2">&quot;INPUT&quot;</span> <span class="o">?</span> 
                            <span class="nx">p_oElement</span><span class="p">.</span><span class="nx">value</span> <span class="o">:</span> <span class="nx">p_oElement</span><span class="p">.</span><span class="nx">innerHTML</span><span class="p">;</span>
        
    
            <span class="k">if</span> <span class="p">(</span><span class="nx">sText</span> <span class="o">&amp;&amp;</span> <span class="nx">sText</span><span class="p">.</span><span class="nx">length</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
                
                <span class="nx">p_oAttributes</span><span class="p">.</span><span class="nx">label</span> <span class="o">=</span> <span class="nx">sText</span><span class="p">;</span>
                
            <span class="p">}</span> 
    
        <span class="p">}</span>
    
    <span class="p">}</span>
    
    
    <span class="cm">/**</span>
<span class="cm">    * @method initConfig</span>
<span class="cm">    * @description Initializes the set of configuration attributes that are </span>
<span class="cm">    * used to instantiate the button.</span>
<span class="cm">    * @private</span>
<span class="cm">    * @param {Object} Object representing the button&#39;s set of </span>
<span class="cm">    * configuration attributes.</span>
<span class="cm">    */</span>
    <span class="kd">function</span> <span class="nx">initConfig</span><span class="p">(</span><span class="nx">p_oConfig</span><span class="p">)</span> <span class="p">{</span>
    
        <span class="kd">var</span> <span class="nx">oAttributes</span> <span class="o">=</span> <span class="nx">p_oConfig</span><span class="p">.</span><span class="nx">attributes</span><span class="p">,</span>
            <span class="nx">oSrcElement</span> <span class="o">=</span> <span class="nx">oAttributes</span><span class="p">.</span><span class="nx">srcelement</span><span class="p">,</span>
            <span class="nx">sSrcElementNodeName</span> <span class="o">=</span> <span class="nx">oSrcElement</span><span class="p">.</span><span class="nx">nodeName</span><span class="p">.</span><span class="nx">toUpperCase</span><span class="p">(),</span>
            <span class="nx">me</span> <span class="o">=</span> <span class="k">this</span><span class="p">;</span>
    
    
        <span class="k">if</span> <span class="p">(</span><span class="nx">sSrcElementNodeName</span> <span class="o">==</span> <span class="k">this</span><span class="p">.</span><span class="nx">NODE_NAME</span><span class="p">)</span> <span class="p">{</span>
    
            <span class="nx">p_oConfig</span><span class="p">.</span><span class="nx">element</span> <span class="o">=</span> <span class="nx">oSrcElement</span><span class="p">;</span>
            <span class="nx">p_oConfig</span><span class="p">.</span><span class="nx">id</span> <span class="o">=</span> <span class="nx">oSrcElement</span><span class="p">.</span><span class="nx">id</span><span class="p">;</span>

            <span class="nx">Dom</span><span class="p">.</span><span class="nx">getElementsBy</span><span class="p">(</span><span class="kd">function</span> <span class="p">(</span><span class="nx">p_oElement</span><span class="p">)</span> <span class="p">{</span>
            
                <span class="k">switch</span> <span class="p">(</span><span class="nx">p_oElement</span><span class="p">.</span><span class="nx">nodeName</span><span class="p">.</span><span class="nx">toUpperCase</span><span class="p">())</span> <span class="p">{</span>
                
                <span class="k">case</span> <span class="s2">&quot;BUTTON&quot;</span><span class="o">:</span>
                <span class="k">case</span> <span class="s2">&quot;A&quot;</span><span class="o">:</span>
                <span class="k">case</span> <span class="s2">&quot;INPUT&quot;</span><span class="o">:</span>

                    <span class="nx">setAttributesFromSrcElement</span><span class="p">.</span><span class="nx">call</span><span class="p">(</span><span class="nx">me</span><span class="p">,</span> <span class="nx">p_oElement</span><span class="p">,</span> 
                        <span class="nx">oAttributes</span><span class="p">);</span>

                    <span class="k">break</span><span class="p">;</span>                        
                
                <span class="p">}</span>
            
            <span class="p">},</span> <span class="s2">&quot;*&quot;</span><span class="p">,</span> <span class="nx">oSrcElement</span><span class="p">);</span>
        
        <span class="p">}</span>
        <span class="k">else</span> <span class="p">{</span>
    
            <span class="k">switch</span> <span class="p">(</span><span class="nx">sSrcElementNodeName</span><span class="p">)</span> <span class="p">{</span>

            <span class="k">case</span> <span class="s2">&quot;BUTTON&quot;</span><span class="o">:</span>
            <span class="k">case</span> <span class="s2">&quot;A&quot;</span><span class="o">:</span>
            <span class="k">case</span> <span class="s2">&quot;INPUT&quot;</span><span class="o">:</span>

                <span class="nx">setAttributesFromSrcElement</span><span class="p">.</span><span class="nx">call</span><span class="p">(</span><span class="k">this</span><span class="p">,</span> <span class="nx">oSrcElement</span><span class="p">,</span> 
                    <span class="nx">oAttributes</span><span class="p">);</span>

                <span class="k">break</span><span class="p">;</span>

            <span class="p">}</span>
        
        <span class="p">}</span>
    
    <span class="p">}</span>



    <span class="c1">//  Constructor</span>

    <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">widget</span><span class="p">.</span><span class="nx">Button</span> <span class="o">=</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">p_oElement</span><span class="p">,</span> <span class="nx">p_oAttributes</span><span class="p">)</span> <span class="p">{</span>
    
		<span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">Overlay</span> <span class="o">&amp;&amp;</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">widget</span><span class="p">.</span><span class="nx">Overlay</span><span class="p">)</span> <span class="p">{</span>
		
			<span class="nx">Overlay</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">widget</span><span class="p">.</span><span class="nx">Overlay</span><span class="p">;</span>
		
		<span class="p">}</span>


		<span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">Menu</span> <span class="o">&amp;&amp;</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">widget</span><span class="p">.</span><span class="nx">Menu</span><span class="p">)</span> <span class="p">{</span>
		
			<span class="nx">Menu</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">widget</span><span class="p">.</span><span class="nx">Menu</span><span class="p">;</span>
		
		<span class="p">}</span>


        <span class="kd">var</span> <span class="nx">fnSuperClass</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">widget</span><span class="p">.</span><span class="nx">Button</span><span class="p">.</span><span class="nx">superclass</span><span class="p">.</span><span class="nx">constructor</span><span class="p">,</span>
            <span class="nx">oConfig</span><span class="p">,</span>
            <span class="nx">oElement</span><span class="p">;</span>
    

        <span class="k">if</span> <span class="p">(</span><span class="nx">arguments</span><span class="p">.</span><span class="nx">length</span> <span class="o">==</span> <span class="mi">1</span> <span class="o">&amp;&amp;</span> <span class="o">!</span><span class="nx">Lang</span><span class="p">.</span><span class="nx">isString</span><span class="p">(</span><span class="nx">p_oElement</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="o">!</span><span class="nx">p_oElement</span><span class="p">.</span><span class="nx">nodeName</span><span class="p">)</span> <span class="p">{</span>
    
            <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">p_oElement</span><span class="p">.</span><span class="nx">id</span><span class="p">)</span> <span class="p">{</span>
    
                <span class="nx">p_oElement</span><span class="p">.</span><span class="nx">id</span> <span class="o">=</span> <span class="nx">Dom</span><span class="p">.</span><span class="nx">generateId</span><span class="p">();</span>
    
                <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;No value specified for the button&#39;s \&quot;id\&quot; &quot;</span> <span class="o">+</span> 
                    <span class="s2">&quot;attribute. Setting button id to \&quot;&quot;</span> <span class="o">+</span> <span class="nx">p_oElement</span><span class="p">.</span><span class="nx">id</span> <span class="o">+</span> 
                    <span class="s2">&quot;\&quot;.&quot;</span><span class="p">,</span> <span class="s2">&quot;info&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
    
            <span class="p">}</span>
    
            <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;No source HTML element.  Building the button &quot;</span> <span class="o">+</span>
                    <span class="s2">&quot;using the set of configuration attributes.&quot;</span><span class="p">,</span> <span class="s2">&quot;info&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
    
            <span class="nx">fnSuperClass</span><span class="p">.</span><span class="nx">call</span><span class="p">(</span><span class="k">this</span><span class="p">,</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">createButtonElement</span><span class="p">(</span><span class="nx">p_oElement</span><span class="p">.</span><span class="nx">type</span><span class="p">)),</span> <span class="nx">p_oElement</span><span class="p">);</span>
    
        <span class="p">}</span>
        <span class="k">else</span> <span class="p">{</span>
    
            <span class="nx">oConfig</span> <span class="o">=</span> <span class="p">{</span> <span class="nx">element</span><span class="o">:</span> <span class="kc">null</span><span class="p">,</span> <span class="nx">attributes</span><span class="o">:</span> <span class="p">(</span><span class="nx">p_oAttributes</span> <span class="o">||</span> <span class="p">{})</span> <span class="p">};</span>
    
    
            <span class="k">if</span> <span class="p">(</span><span class="nx">Lang</span><span class="p">.</span><span class="nx">isString</span><span class="p">(</span><span class="nx">p_oElement</span><span class="p">))</span> <span class="p">{</span>
    
                <span class="nx">oElement</span> <span class="o">=</span> <span class="nx">Dom</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="nx">p_oElement</span><span class="p">);</span>
    
                <span class="k">if</span> <span class="p">(</span><span class="nx">oElement</span><span class="p">)</span> <span class="p">{</span>

                    <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">oConfig</span><span class="p">.</span><span class="nx">attributes</span><span class="p">.</span><span class="nx">id</span><span class="p">)</span> <span class="p">{</span>
                    
                        <span class="nx">oConfig</span><span class="p">.</span><span class="nx">attributes</span><span class="p">.</span><span class="nx">id</span> <span class="o">=</span> <span class="nx">p_oElement</span><span class="p">;</span>
                    
                    <span class="p">}</span>
    
                    <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Building the button using an existing &quot;</span> <span class="o">+</span> 
                            <span class="s2">&quot;HTML element as a source element.&quot;</span><span class="p">,</span> <span class="s2">&quot;info&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
                
                
                    <span class="nx">oConfig</span><span class="p">.</span><span class="nx">attributes</span><span class="p">.</span><span class="nx">srcelement</span> <span class="o">=</span> <span class="nx">oElement</span><span class="p">;</span>
                
                    <span class="nx">initConfig</span><span class="p">.</span><span class="nx">call</span><span class="p">(</span><span class="k">this</span><span class="p">,</span> <span class="nx">oConfig</span><span class="p">);</span>
                
                
                    <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">oConfig</span><span class="p">.</span><span class="nx">element</span><span class="p">)</span> <span class="p">{</span>
                
                        <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Source element could not be used &quot;</span> <span class="o">+</span>
                                <span class="s2">&quot;as is.  Creating a new HTML element for &quot;</span> <span class="o">+</span> 
                                <span class="s2">&quot;the button.&quot;</span><span class="p">,</span> <span class="s2">&quot;info&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
                
                        <span class="nx">oConfig</span><span class="p">.</span><span class="nx">element</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">createButtonElement</span><span class="p">(</span><span class="nx">oConfig</span><span class="p">.</span><span class="nx">attributes</span><span class="p">.</span><span class="nx">type</span><span class="p">);</span>
                
                    <span class="p">}</span>
                
                    <span class="nx">fnSuperClass</span><span class="p">.</span><span class="nx">call</span><span class="p">(</span><span class="k">this</span><span class="p">,</span> <span class="nx">oConfig</span><span class="p">.</span><span class="nx">element</span><span class="p">,</span> <span class="nx">oConfig</span><span class="p">.</span><span class="nx">attributes</span><span class="p">);</span>
    
                <span class="p">}</span>
    
            <span class="p">}</span>
            <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="nx">p_oElement</span><span class="p">.</span><span class="nx">nodeName</span><span class="p">)</span> <span class="p">{</span>
    
                <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">oConfig</span><span class="p">.</span><span class="nx">attributes</span><span class="p">.</span><span class="nx">id</span><span class="p">)</span> <span class="p">{</span>
    
                    <span class="k">if</span> <span class="p">(</span><span class="nx">p_oElement</span><span class="p">.</span><span class="nx">id</span><span class="p">)</span> <span class="p">{</span>
        
                        <span class="nx">oConfig</span><span class="p">.</span><span class="nx">attributes</span><span class="p">.</span><span class="nx">id</span> <span class="o">=</span> <span class="nx">p_oElement</span><span class="p">.</span><span class="nx">id</span><span class="p">;</span>
                    
                    <span class="p">}</span>
                    <span class="k">else</span> <span class="p">{</span>
        
                        <span class="nx">oConfig</span><span class="p">.</span><span class="nx">attributes</span><span class="p">.</span><span class="nx">id</span> <span class="o">=</span> <span class="nx">Dom</span><span class="p">.</span><span class="nx">generateId</span><span class="p">();</span>
        
                        <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;No value specified for the button&#39;s &quot;</span> <span class="o">+</span>
                            <span class="s2">&quot;\&quot;id\&quot; attribute. Setting button id to \&quot;&quot;</span> <span class="o">+</span> 
                            <span class="nx">oConfig</span><span class="p">.</span><span class="nx">attributes</span><span class="p">.</span><span class="nx">id</span> <span class="o">+</span> <span class="s2">&quot;\&quot;.&quot;</span><span class="p">,</span> <span class="s2">&quot;info&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
        
                    <span class="p">}</span>
    
                <span class="p">}</span>
    
                <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Building the button using an existing HTML &quot;</span> <span class="o">+</span> 
                    <span class="s2">&quot;element as a source element.&quot;</span><span class="p">,</span> <span class="s2">&quot;info&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
    
    
                <span class="nx">oConfig</span><span class="p">.</span><span class="nx">attributes</span><span class="p">.</span><span class="nx">srcelement</span> <span class="o">=</span> <span class="nx">p_oElement</span><span class="p">;</span>
        
                <span class="nx">initConfig</span><span class="p">.</span><span class="nx">call</span><span class="p">(</span><span class="k">this</span><span class="p">,</span> <span class="nx">oConfig</span><span class="p">);</span>
        
        
                <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">oConfig</span><span class="p">.</span><span class="nx">element</span><span class="p">)</span> <span class="p">{</span>
    
                    <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Source element could not be used as is.&quot;</span> <span class="o">+</span>
                            <span class="s2">&quot;  Creating a new HTML element for the button.&quot;</span><span class="p">,</span> 
                            <span class="s2">&quot;info&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
            
                    <span class="nx">oConfig</span><span class="p">.</span><span class="nx">element</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">createButtonElement</span><span class="p">(</span><span class="nx">oConfig</span><span class="p">.</span><span class="nx">attributes</span><span class="p">.</span><span class="nx">type</span><span class="p">);</span>
            
                <span class="p">}</span>
            
                <span class="nx">fnSuperClass</span><span class="p">.</span><span class="nx">call</span><span class="p">(</span><span class="k">this</span><span class="p">,</span> <span class="nx">oConfig</span><span class="p">.</span><span class="nx">element</span><span class="p">,</span> <span class="nx">oConfig</span><span class="p">.</span><span class="nx">attributes</span><span class="p">);</span>
            
            <span class="p">}</span>
    
        <span class="p">}</span>
    
    <span class="p">};</span>



    <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">extend</span><span class="p">(</span><span class="nx">YAHOO</span><span class="p">.</span><span class="nx">widget</span><span class="p">.</span><span class="nx">Button</span><span class="p">,</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">Element</span><span class="p">,</span> <span class="p">{</span>
    
    
        <span class="c1">// Protected properties</span>
        
        
        <span class="cm">/** </span>
<span class="cm">        * @property _button</span>
<span class="cm">        * @description Object reference to the button&#39;s internal </span>
<span class="cm">        * &lt;code&gt;&amp;#60;a&amp;#62;&lt;/code&gt; or &lt;code&gt;&amp;#60;button&amp;#62;&lt;/code&gt; element.</span>
<span class="cm">        * @default null</span>
<span class="cm">        * @protected</span>
<span class="cm">        * @type &lt;a href=&quot;http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/</span>
<span class="cm">        * level-one-html.html#ID-48250443&quot;&gt;HTMLAnchorElement&lt;/a&gt;|&lt;a href=&quot;</span>
<span class="cm">        * http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-html.html</span>
<span class="cm">        * #ID-34812697&quot;&gt;HTMLButtonElement&lt;/a&gt;</span>
<span class="cm">        */</span>
        <span class="nx">_button</span><span class="o">:</span> <span class="kc">null</span><span class="p">,</span>
        
        
        <span class="cm">/** </span>
<span class="cm">        * @property _menu</span>
<span class="cm">        * @description Object reference to the button&#39;s menu.</span>
<span class="cm">        * @default null</span>
<span class="cm">        * @protected</span>
<span class="cm">        * @type {&lt;a href=&quot;YAHOO.widget.Overlay.html&quot;&gt;YAHOO.widget.Overlay&lt;/a&gt;|</span>
<span class="cm">        * &lt;a href=&quot;YAHOO.widget.Menu.html&quot;&gt;YAHOO.widget.Menu&lt;/a&gt;}</span>
<span class="cm">        */</span>
        <span class="nx">_menu</span><span class="o">:</span> <span class="kc">null</span><span class="p">,</span>
        
        
        <span class="cm">/** </span>
<span class="cm">        * @property _hiddenFields</span>
<span class="cm">        * @description Object reference to the &lt;code&gt;&amp;#60;input&amp;#62;&lt;/code&gt;  </span>
<span class="cm">        * element, or array of HTML form elements used to represent the button</span>
<span class="cm">        *  when its parent form is submitted.</span>
<span class="cm">        * @default null</span>
<span class="cm">        * @protected</span>
<span class="cm">        * @type &lt;a href=&quot;http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/</span>
<span class="cm">        * level-one-html.html#ID-6043025&quot;&gt;HTMLInputElement&lt;/a&gt;|Array</span>
<span class="cm">        */</span>
        <span class="nx">_hiddenFields</span><span class="o">:</span> <span class="kc">null</span><span class="p">,</span>
        
        
        <span class="cm">/** </span>
<span class="cm">        * @property _onclickAttributeValue</span>
<span class="cm">        * @description Object reference to the button&#39;s current value for the </span>
<span class="cm">        * &quot;onclick&quot; configuration attribute.</span>
<span class="cm">        * @default null</span>
<span class="cm">        * @protected</span>
<span class="cm">        * @type Object</span>
<span class="cm">        */</span>
        <span class="nx">_onclickAttributeValue</span><span class="o">:</span> <span class="kc">null</span><span class="p">,</span>
        
        
        <span class="cm">/** </span>
<span class="cm">        * @property _activationKeyPressed</span>
<span class="cm">        * @description Boolean indicating if the key(s) that toggle the button&#39;s </span>
<span class="cm">        * &quot;active&quot; state have been pressed.</span>
<span class="cm">        * @default false</span>
<span class="cm">        * @protected</span>
<span class="cm">        * @type Boolean</span>
<span class="cm">        */</span>
        <span class="nx">_activationKeyPressed</span><span class="o">:</span> <span class="kc">false</span><span class="p">,</span>
        
        
        <span class="cm">/** </span>
<span class="cm">        * @property _activationButtonPressed</span>
<span class="cm">        * @description Boolean indicating if the mouse button that toggles </span>
<span class="cm">        * the button&#39;s &quot;active&quot; state has been pressed.</span>
<span class="cm">        * @default false</span>
<span class="cm">        * @protected</span>
<span class="cm">        * @type Boolean</span>
<span class="cm">        */</span>
        <span class="nx">_activationButtonPressed</span><span class="o">:</span> <span class="kc">false</span><span class="p">,</span>
        
        
        <span class="cm">/** </span>
<span class="cm">        * @property _hasKeyEventHandlers</span>
<span class="cm">        * @description Boolean indicating if the button&#39;s &quot;blur&quot;, &quot;keydown&quot; and </span>
<span class="cm">        * &quot;keyup&quot; event handlers are assigned</span>
<span class="cm">        * @default false</span>
<span class="cm">        * @protected</span>
<span class="cm">        * @type Boolean</span>
<span class="cm">        */</span>
        <span class="nx">_hasKeyEventHandlers</span><span class="o">:</span> <span class="kc">false</span><span class="p">,</span>
        
        
        <span class="cm">/** </span>
<span class="cm">        * @property _hasMouseEventHandlers</span>
<span class="cm">        * @description Boolean indicating if the button&#39;s &quot;mouseout,&quot; </span>
<span class="cm">        * &quot;mousedown,&quot; and &quot;mouseup&quot; event handlers are assigned</span>
<span class="cm">        * @default false</span>
<span class="cm">        * @protected</span>
<span class="cm">        * @type Boolean</span>
<span class="cm">        */</span>
        <span class="nx">_hasMouseEventHandlers</span><span class="o">:</span> <span class="kc">false</span><span class="p">,</span>


        <span class="cm">/** </span>
<span class="cm">        * @property _nOptionRegionX</span>
<span class="cm">        * @description Number representing the X coordinate of the leftmost edge of the Button&#39;s </span>
<span class="cm">        * option region.  Applies only to Buttons of type &quot;split&quot;.</span>
<span class="cm">        * @default 0</span>
<span class="cm">        * @protected</span>
<span class="cm">        * @type Number</span>
<span class="cm">        */</span>        
        <span class="nx">_nOptionRegionX</span><span class="o">:</span> <span class="mi">0</span><span class="p">,</span>
        


        <span class="c1">// Constants</span>

        <span class="cm">/**</span>
<span class="cm">        * @property CLASS_NAME_PREFIX</span>
<span class="cm">        * @description Prefix used for all class names applied to a Button.</span>
<span class="cm">        * @default &quot;yui-&quot;</span>
<span class="cm">        * @final</span>
<span class="cm">        * @type String</span>
<span class="cm">        */</span>
        <span class="nx">CLASS_NAME_PREFIX</span><span class="o">:</span> <span class="s2">&quot;yui-&quot;</span><span class="p">,</span>
        
        
        <span class="cm">/**</span>
<span class="cm">        * @property NODE_NAME</span>
<span class="cm">        * @description The name of the node to be used for the button&#39;s </span>
<span class="cm">        * root element.</span>
<span class="cm">        * @default &quot;SPAN&quot;</span>
<span class="cm">        * @final</span>
<span class="cm">        * @type String</span>
<span class="cm">        */</span>
        <span class="nx">NODE_NAME</span><span class="o">:</span> <span class="s2">&quot;SPAN&quot;</span><span class="p">,</span>
        
        
        <span class="cm">/**</span>
<span class="cm">        * @property CHECK_ACTIVATION_KEYS</span>
<span class="cm">        * @description Array of numbers representing keys that (when pressed) </span>
<span class="cm">        * toggle the button&#39;s &quot;checked&quot; attribute.</span>
<span class="cm">        * @default [32]</span>
<span class="cm">        * @final</span>
<span class="cm">        * @type Array</span>
<span class="cm">        */</span>
        <span class="nx">CHECK_ACTIVATION_KEYS</span><span class="o">:</span> <span class="p">[</span><span class="mi">32</span><span class="p">],</span>
        
        
        <span class="cm">/**</span>
<span class="cm">        * @property ACTIVATION_KEYS</span>
<span class="cm">        * @description Array of numbers representing keys that (when presed) </span>
<span class="cm">        * toggle the button&#39;s &quot;active&quot; state.</span>
<span class="cm">        * @default [13, 32]</span>
<span class="cm">        * @final</span>
<span class="cm">        * @type Array</span>
<span class="cm">        */</span>
        <span class="nx">ACTIVATION_KEYS</span><span class="o">:</span> <span class="p">[</span><span class="mi">13</span><span class="p">,</span> <span class="mi">32</span><span class="p">],</span>
        
        
        <span class="cm">/**</span>
<span class="cm">        * @property OPTION_AREA_WIDTH</span>
<span class="cm">        * @description Width (in pixels) of the area of a split button that  </span>
<span class="cm">        * when pressed will display a menu.</span>
<span class="cm">        * @default 20</span>
<span class="cm">        * @final</span>
<span class="cm">        * @type Number</span>
<span class="cm">        */</span>
        <span class="nx">OPTION_AREA_WIDTH</span><span class="o">:</span> <span class="mi">20</span><span class="p">,</span>
        
        
        <span class="cm">/**</span>
<span class="cm">        * @property CSS_CLASS_NAME</span>
<span class="cm">        * @description String representing the CSS class(es) to be applied to  </span>
<span class="cm">        * the button&#39;s root element.</span>
<span class="cm">        * @default &quot;button&quot;</span>
<span class="cm">        * @final</span>
<span class="cm">        * @type String</span>
<span class="cm">        */</span>
        <span class="nx">CSS_CLASS_NAME</span><span class="o">:</span> <span class="s2">&quot;button&quot;</span><span class="p">,</span>
        
        
        
        <span class="c1">// Protected attribute setter methods</span>
        
        
        <span class="cm">/**</span>
<span class="cm">        * @method _setType</span>
<span class="cm">        * @description Sets the value of the button&#39;s &quot;type&quot; attribute.</span>
<span class="cm">        * @protected</span>
<span class="cm">        * @param {String} p_sType String indicating the value for the button&#39;s </span>
<span class="cm">        * &quot;type&quot; attribute.</span>
<span class="cm">        */</span>
        <span class="nx">_setType</span><span class="o">:</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">p_sType</span><span class="p">)</span> <span class="p">{</span>
        
            <span class="k">if</span> <span class="p">(</span><span class="nx">p_sType</span> <span class="o">==</span> <span class="s2">&quot;split&quot;</span><span class="p">)</span> <span class="p">{</span>
        
                <span class="k">this</span><span class="p">.</span><span class="nx">on</span><span class="p">(</span><span class="s2">&quot;option&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_onOption</span><span class="p">);</span>
        
            <span class="p">}</span>
        
        <span class="p">},</span>
        
        
        <span class="cm">/**</span>
<span class="cm">        * @method _setLabel</span>
<span class="cm">        * @description Sets the value of the button&#39;s &quot;label&quot; attribute.</span>
<span class="cm">        * @protected</span>
<span class="cm">        * @param {HTML} p_sLabel String indicating the value for the button&#39;s </span>
<span class="cm">        * &quot;label&quot; attribute.</span>
<span class="cm">        */</span>
        <span class="nx">_setLabel</span><span class="o">:</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">p_sLabel</span><span class="p">)</span> <span class="p">{</span>

            <span class="k">this</span><span class="p">.</span><span class="nx">_button</span><span class="p">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="nx">p_sLabel</span><span class="p">;</span>

            
            <span class="cm">/*</span>
<span class="cm">                Remove and add the default class name from the root element</span>
<span class="cm">                for Gecko to ensure that the button shrinkwraps to the label.</span>
<span class="cm">                Without this the button will not be rendered at the correct </span>
<span class="cm">                width when the label changes.  The most likely cause for this </span>
<span class="cm">                bug is button&#39;s use of the Gecko-specific CSS display type of </span>
<span class="cm">                &quot;-moz-inline-box&quot; to simulate &quot;inline-block&quot; supported by IE, </span>
<span class="cm">                Safari and Opera.</span>
<span class="cm">            */</span>
            
            <span class="kd">var</span> <span class="nx">sClass</span><span class="p">,</span>
                <span class="nx">nGeckoVersion</span> <span class="o">=</span> <span class="nx">UA</span><span class="p">.</span><span class="nx">gecko</span><span class="p">;</span>
				
            
            <span class="k">if</span> <span class="p">(</span><span class="nx">nGeckoVersion</span> <span class="o">&amp;&amp;</span> <span class="nx">nGeckoVersion</span> <span class="o">&lt;</span> <span class="mf">1.9</span> <span class="o">&amp;&amp;</span> <span class="nx">Dom</span><span class="p">.</span><span class="nx">inDocument</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;element&quot;</span><span class="p">)))</span> <span class="p">{</span>
            
                <span class="nx">sClass</span> <span class="o">=</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">CLASS_NAME_PREFIX</span> <span class="o">+</span> <span class="k">this</span><span class="p">.</span><span class="nx">CSS_CLASS_NAME</span><span class="p">);</span>

                <span class="k">this</span><span class="p">.</span><span class="nx">removeClass</span><span class="p">(</span><span class="nx">sClass</span><span class="p">);</span>
                
                <span class="nx">Lang</span><span class="p">.</span><span class="nx">later</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="k">this</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">addClass</span><span class="p">,</span> <span class="nx">sClass</span><span class="p">);</span>

            <span class="p">}</span>
        
        <span class="p">},</span>
        
        
        <span class="cm">/**</span>
<span class="cm">        * @method _setTabIndex</span>
<span class="cm">        * @description Sets the value of the button&#39;s &quot;tabindex&quot; attribute.</span>
<span class="cm">        * @protected</span>
<span class="cm">        * @param {Number} p_nTabIndex Number indicating the value for the </span>
<span class="cm">        * button&#39;s &quot;tabindex&quot; attribute.</span>
<span class="cm">        */</span>
        <span class="nx">_setTabIndex</span><span class="o">:</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">p_nTabIndex</span><span class="p">)</span> <span class="p">{</span>
        
            <span class="k">this</span><span class="p">.</span><span class="nx">_button</span><span class="p">.</span><span class="nx">tabIndex</span> <span class="o">=</span> <span class="nx">p_nTabIndex</span><span class="p">;</span>
        
        <span class="p">},</span>
        
        
        <span class="cm">/**</span>
<span class="cm">        * @method _setTitle</span>
<span class="cm">        * @description Sets the value of the button&#39;s &quot;title&quot; attribute.</span>
<span class="cm">        * @protected</span>
<span class="cm">        * @param {String} p_nTabIndex Number indicating the value for </span>
<span class="cm">        * the button&#39;s &quot;title&quot; attribute.</span>
<span class="cm">        */</span>
        <span class="nx">_setTitle</span><span class="o">:</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">p_sTitle</span><span class="p">)</span> <span class="p">{</span>
        
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;type&quot;</span><span class="p">)</span> <span class="o">!=</span> <span class="s2">&quot;link&quot;</span><span class="p">)</span> <span class="p">{</span>
        
                <span class="k">this</span><span class="p">.</span><span class="nx">_button</span><span class="p">.</span><span class="nx">title</span> <span class="o">=</span> <span class="nx">p_sTitle</span><span class="p">;</span>
        
            <span class="p">}</span>
        
        <span class="p">},</span>
        
        
        <span class="cm">/**</span>
<span class="cm">        * @method _setDisabled</span>
<span class="cm">        * @description Sets the value of the button&#39;s &quot;disabled&quot; attribute.</span>
<span class="cm">        * @protected</span>
<span class="cm">        * @param {Boolean} p_bDisabled Boolean indicating the value for </span>
<span class="cm">        * the button&#39;s &quot;disabled&quot; attribute.</span>
<span class="cm">        */</span>
        <span class="nx">_setDisabled</span><span class="o">:</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">p_bDisabled</span><span class="p">)</span> <span class="p">{</span>
        
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;type&quot;</span><span class="p">)</span> <span class="o">!=</span> <span class="s2">&quot;link&quot;</span><span class="p">)</span> <span class="p">{</span>
        
                <span class="k">if</span> <span class="p">(</span><span class="nx">p_bDisabled</span><span class="p">)</span> <span class="p">{</span>
        
                    <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_menu</span><span class="p">)</span> <span class="p">{</span>
        
                        <span class="k">this</span><span class="p">.</span><span class="nx">_menu</span><span class="p">.</span><span class="nx">hide</span><span class="p">();</span>
        
                    <span class="p">}</span>
        
                    <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">hasFocus</span><span class="p">())</span> <span class="p">{</span>
                    
                        <span class="k">this</span><span class="p">.</span><span class="nx">blur</span><span class="p">();</span>
                    
                    <span class="p">}</span>
        
                    <span class="k">this</span><span class="p">.</span><span class="nx">_button</span><span class="p">.</span><span class="nx">setAttribute</span><span class="p">(</span><span class="s2">&quot;disabled&quot;</span><span class="p">,</span> <span class="s2">&quot;disabled&quot;</span><span class="p">);</span>
        
                    <span class="k">this</span><span class="p">.</span><span class="nx">addStateCSSClasses</span><span class="p">(</span><span class="s2">&quot;disabled&quot;</span><span class="p">);</span>

                    <span class="k">this</span><span class="p">.</span><span class="nx">removeStateCSSClasses</span><span class="p">(</span><span class="s2">&quot;hover&quot;</span><span class="p">);</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">removeStateCSSClasses</span><span class="p">(</span><span class="s2">&quot;active&quot;</span><span class="p">);</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">removeStateCSSClasses</span><span class="p">(</span><span class="s2">&quot;focus&quot;</span><span class="p">);</span>
        
                <span class="p">}</span>
                <span class="k">else</span> <span class="p">{</span>
        
                    <span class="k">this</span><span class="p">.</span><span class="nx">_button</span><span class="p">.</span><span class="nx">removeAttribute</span><span class="p">(</span><span class="s2">&quot;disabled&quot;</span><span class="p">);</span>
        
                    <span class="k">this</span><span class="p">.</span><span class="nx">removeStateCSSClasses</span><span class="p">(</span><span class="s2">&quot;disabled&quot;</span><span class="p">);</span>
                
                <span class="p">}</span>
        
            <span class="p">}</span>
        
        <span class="p">},</span>

        
        <span class="cm">/**</span>
<span class="cm">        * @method _setHref</span>
<span class="cm">        * @description Sets the value of the button&#39;s &quot;href&quot; attribute.</span>
<span class="cm">        * @protected</span>
<span class="cm">        * @param {String} p_sHref String indicating the value for the button&#39;s </span>
<span class="cm">        * &quot;href&quot; attribute.</span>
<span class="cm">        */</span>
        <span class="nx">_setHref</span><span class="o">:</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">p_sHref</span><span class="p">)</span> <span class="p">{</span>
        
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;type&quot;</span><span class="p">)</span> <span class="o">==</span> <span class="s2">&quot;link&quot;</span><span class="p">)</span> <span class="p">{</span>
        
                <span class="k">this</span><span class="p">.</span><span class="nx">_button</span><span class="p">.</span><span class="nx">href</span> <span class="o">=</span> <span class="nx">p_sHref</span><span class="p">;</span>
            
            <span class="p">}</span>
        
        <span class="p">},</span>
        
        
        <span class="cm">/**</span>
<span class="cm">        * @method _setTarget</span>
<span class="cm">        * @description Sets the value of the button&#39;s &quot;target&quot; attribute.</span>
<span class="cm">        * @protected</span>
<span class="cm">        * @param {String} p_sTarget String indicating the value for the button&#39;s </span>
<span class="cm">        * &quot;target&quot; attribute.</span>
<span class="cm">        */</span>
        <span class="nx">_setTarget</span><span class="o">:</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">p_sTarget</span><span class="p">)</span> <span class="p">{</span>
        
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;type&quot;</span><span class="p">)</span> <span class="o">==</span> <span class="s2">&quot;link&quot;</span><span class="p">)</span> <span class="p">{</span>
        
                <span class="k">this</span><span class="p">.</span><span class="nx">_button</span><span class="p">.</span><span class="nx">setAttribute</span><span class="p">(</span><span class="s2">&quot;target&quot;</span><span class="p">,</span> <span class="nx">p_sTarget</span><span class="p">);</span>
            
            <span class="p">}</span>
        
        <span class="p">},</span>
        
        
        <span class="cm">/**</span>
<span class="cm">        * @method _setChecked</span>
<span class="cm">        * @description Sets the value of the button&#39;s &quot;target&quot; attribute.</span>
<span class="cm">        * @protected</span>
<span class="cm">        * @param {Boolean} p_bChecked Boolean indicating the value for  </span>
<span class="cm">        * the button&#39;s &quot;checked&quot; attribute.</span>
<span class="cm">        */</span>
        <span class="nx">_setChecked</span><span class="o">:</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">p_bChecked</span><span class="p">)</span> <span class="p">{</span>
        
            <span class="kd">var</span> <span class="nx">sType</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;type&quot;</span><span class="p">);</span>
        
            <span class="k">if</span> <span class="p">(</span><span class="nx">sType</span> <span class="o">==</span> <span class="s2">&quot;checkbox&quot;</span> <span class="o">||</span> <span class="nx">sType</span> <span class="o">==</span> <span class="s2">&quot;radio&quot;</span><span class="p">)</span> <span class="p">{</span>
        
                <span class="k">if</span> <span class="p">(</span><span class="nx">p_bChecked</span><span class="p">)</span> <span class="p">{</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">addStateCSSClasses</span><span class="p">(</span><span class="s2">&quot;checked&quot;</span><span class="p">);</span>
                <span class="p">}</span>
                <span class="k">else</span> <span class="p">{</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">removeStateCSSClasses</span><span class="p">(</span><span class="s2">&quot;checked&quot;</span><span class="p">);</span>
                <span class="p">}</span>
        
            <span class="p">}</span>
        
        <span class="p">},</span>

        
        <span class="cm">/**</span>
<span class="cm">        * @method _setMenu</span>
<span class="cm">        * @description Sets the value of the button&#39;s &quot;menu&quot; attribute.</span>
<span class="cm">        * @protected</span>
<span class="cm">        * @param {Object} p_oMenu Object indicating the value for the button&#39;s </span>
<span class="cm">        * &quot;menu&quot; attribute.</span>
<span class="cm">        */</span>
        <span class="nx">_setMenu</span><span class="o">:</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">p_oMenu</span><span class="p">)</span> <span class="p">{</span>

            <span class="kd">var</span> <span class="nx">bLazyLoad</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;lazyloadmenu&quot;</span><span class="p">),</span>
                <span class="nx">oButtonElement</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;element&quot;</span><span class="p">),</span>
                <span class="nx">sMenuCSSClassName</span><span class="p">,</span>
        
                <span class="cm">/*</span>
<span class="cm">                    Boolean indicating if the value of p_oMenu is an instance </span>
<span class="cm">                    of YAHOO.widget.Menu or YAHOO.widget.Overlay.</span>
<span class="cm">                */</span>
        
                <span class="nx">bInstance</span> <span class="o">=</span> <span class="kc">false</span><span class="p">,</span>
                <span class="nx">oMenu</span><span class="p">,</span>
                <span class="nx">oMenuElement</span><span class="p">,</span>
                <span class="nx">oSrcElement</span><span class="p">;</span>
        

			<span class="kd">function</span> <span class="nx">onAppendTo</span><span class="p">()</span> <span class="p">{</span>

				<span class="nx">oMenu</span><span class="p">.</span><span class="nx">render</span><span class="p">(</span><span class="nx">oButtonElement</span><span class="p">.</span><span class="nx">parentNode</span><span class="p">);</span>
				
				<span class="k">this</span><span class="p">.</span><span class="nx">removeListener</span><span class="p">(</span><span class="s2">&quot;appendTo&quot;</span><span class="p">,</span> <span class="nx">onAppendTo</span><span class="p">);</span>
			
			<span class="p">}</span>
			
			
			<span class="kd">function</span> <span class="nx">setMenuContainer</span><span class="p">()</span> <span class="p">{</span>

				<span class="nx">oMenu</span><span class="p">.</span><span class="nx">cfg</span><span class="p">.</span><span class="nx">queueProperty</span><span class="p">(</span><span class="s2">&quot;container&quot;</span><span class="p">,</span> <span class="nx">oButtonElement</span><span class="p">.</span><span class="nx">parentNode</span><span class="p">);</span>
				
				<span class="k">this</span><span class="p">.</span><span class="nx">removeListener</span><span class="p">(</span><span class="s2">&quot;appendTo&quot;</span><span class="p">,</span> <span class="nx">setMenuContainer</span><span class="p">);</span>
			
			<span class="p">}</span>


			<span class="kd">function</span> <span class="nx">initMenu</span><span class="p">()</span> <span class="p">{</span>
		
				<span class="kd">var</span> <span class="nx">oContainer</span><span class="p">;</span>
		
				<span class="k">if</span> <span class="p">(</span><span class="nx">oMenu</span><span class="p">)</span> <span class="p">{</span>

					<span class="nx">Dom</span><span class="p">.</span><span class="nx">addClass</span><span class="p">(</span><span class="nx">oMenu</span><span class="p">.</span><span class="nx">element</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;menuclassname&quot;</span><span class="p">));</span>
					<span class="nx">Dom</span><span class="p">.</span><span class="nx">addClass</span><span class="p">(</span><span class="nx">oMenu</span><span class="p">.</span><span class="nx">element</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">CLASS_NAME_PREFIX</span> <span class="o">+</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;type&quot;</span><span class="p">)</span> <span class="o">+</span> <span class="s2">&quot;-button-menu&quot;</span><span class="p">);</span>

					<span class="nx">oMenu</span><span class="p">.</span><span class="nx">showEvent</span><span class="p">.</span><span class="nx">subscribe</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_onMenuShow</span><span class="p">,</span> <span class="kc">null</span><span class="p">,</span> <span class="k">this</span><span class="p">);</span>
					<span class="nx">oMenu</span><span class="p">.</span><span class="nx">hideEvent</span><span class="p">.</span><span class="nx">subscribe</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_onMenuHide</span><span class="p">,</span> <span class="kc">null</span><span class="p">,</span> <span class="k">this</span><span class="p">);</span>
					<span class="nx">oMenu</span><span class="p">.</span><span class="nx">renderEvent</span><span class="p">.</span><span class="nx">subscribe</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_onMenuRender</span><span class="p">,</span> <span class="kc">null</span><span class="p">,</span> <span class="k">this</span><span class="p">);</span>


					<span class="k">if</span> <span class="p">(</span><span class="nx">Menu</span> <span class="o">&amp;&amp;</span> <span class="nx">oMenu</span> <span class="k">instanceof</span> <span class="nx">Menu</span><span class="p">)</span> <span class="p">{</span>

						<span class="k">if</span> <span class="p">(</span><span class="nx">bLazyLoad</span><span class="p">)</span> <span class="p">{</span>

							<span class="nx">oContainer</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;container&quot;</span><span class="p">);</span>

							<span class="k">if</span> <span class="p">(</span><span class="nx">oContainer</span><span class="p">)</span> <span class="p">{</span>

								<span class="nx">oMenu</span><span class="p">.</span><span class="nx">cfg</span><span class="p">.</span><span class="nx">queueProperty</span><span class="p">(</span><span class="s2">&quot;container&quot;</span><span class="p">,</span> <span class="nx">oContainer</span><span class="p">);</span>

							<span class="p">}</span>
							<span class="k">else</span> <span class="p">{</span>

								<span class="k">this</span><span class="p">.</span><span class="nx">on</span><span class="p">(</span><span class="s2">&quot;appendTo&quot;</span><span class="p">,</span> <span class="nx">setMenuContainer</span><span class="p">);</span>

							<span class="p">}</span>

						<span class="p">}</span>

						<span class="nx">oMenu</span><span class="p">.</span><span class="nx">cfg</span><span class="p">.</span><span class="nx">queueProperty</span><span class="p">(</span><span class="s2">&quot;clicktohide&quot;</span><span class="p">,</span> <span class="kc">false</span><span class="p">);</span>

						<span class="nx">oMenu</span><span class="p">.</span><span class="nx">keyDownEvent</span><span class="p">.</span><span class="nx">subscribe</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_onMenuKeyDown</span><span class="p">,</span> <span class="k">this</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span>
						<span class="nx">oMenu</span><span class="p">.</span><span class="nx">subscribe</span><span class="p">(</span><span class="s2">&quot;click&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_onMenuClick</span><span class="p">,</span> <span class="k">this</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span>

						<span class="k">this</span><span class="p">.</span><span class="nx">on</span><span class="p">(</span><span class="s2">&quot;selectedMenuItemChange&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_onSelectedMenuItemChange</span><span class="p">);</span>
		
						<span class="nx">oSrcElement</span> <span class="o">=</span> <span class="nx">oMenu</span><span class="p">.</span><span class="nx">srcElement</span><span class="p">;</span>
		
						<span class="k">if</span> <span class="p">(</span><span class="nx">oSrcElement</span> <span class="o">&amp;&amp;</span> <span class="nx">oSrcElement</span><span class="p">.</span><span class="nx">nodeName</span><span class="p">.</span><span class="nx">toUpperCase</span><span class="p">()</span> <span class="o">==</span> <span class="s2">&quot;SELECT&quot;</span><span class="p">)</span> <span class="p">{</span>

							<span class="nx">oSrcElement</span><span class="p">.</span><span class="nx">style</span><span class="p">.</span><span class="nx">display</span> <span class="o">=</span> <span class="s2">&quot;none&quot;</span><span class="p">;</span>
							<span class="nx">oSrcElement</span><span class="p">.</span><span class="nx">parentNode</span><span class="p">.</span><span class="nx">removeChild</span><span class="p">(</span><span class="nx">oSrcElement</span><span class="p">);</span>
		
						<span class="p">}</span>
		
					<span class="p">}</span>
					<span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="nx">Overlay</span> <span class="o">&amp;&amp;</span> <span class="nx">oMenu</span> <span class="k">instanceof</span> <span class="nx">Overlay</span><span class="p">)</span> <span class="p">{</span>
		
						<span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">m_oOverlayManager</span><span class="p">)</span> <span class="p">{</span>
		
							<span class="nx">m_oOverlayManager</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">widget</span><span class="p">.</span><span class="nx">OverlayManager</span><span class="p">();</span>
						
						<span class="p">}</span>
						
						<span class="nx">m_oOverlayManager</span><span class="p">.</span><span class="nx">register</span><span class="p">(</span><span class="nx">oMenu</span><span class="p">);</span>
						
					<span class="p">}</span>
		
		
					<span class="k">this</span><span class="p">.</span><span class="nx">_menu</span> <span class="o">=</span> <span class="nx">oMenu</span><span class="p">;</span>

		
					<span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">bInstance</span> <span class="o">&amp;&amp;</span> <span class="o">!</span><span class="nx">bLazyLoad</span><span class="p">)</span> <span class="p">{</span>
		
						<span class="k">if</span> <span class="p">(</span><span class="nx">Dom</span><span class="p">.</span><span class="nx">inDocument</span><span class="p">(</span><span class="nx">oButtonElement</span><span class="p">))</span> <span class="p">{</span>
	
							<span class="nx">oMenu</span><span class="p">.</span><span class="nx">render</span><span class="p">(</span><span class="nx">oButtonElement</span><span class="p">.</span><span class="nx">parentNode</span><span class="p">);</span>
						
						<span class="p">}</span>
						<span class="k">else</span> <span class="p">{</span>
		
							<span class="k">this</span><span class="p">.</span><span class="nx">on</span><span class="p">(</span><span class="s2">&quot;appendTo&quot;</span><span class="p">,</span> <span class="nx">onAppendTo</span><span class="p">);</span>
						
						<span class="p">}</span>
					
					<span class="p">}</span>
		
				<span class="p">}</span>
		
			<span class="p">}</span>

        
            <span class="k">if</span> <span class="p">(</span><span class="nx">Overlay</span><span class="p">)</span> <span class="p">{</span>
        
				<span class="k">if</span> <span class="p">(</span><span class="nx">Menu</span><span class="p">)</span> <span class="p">{</span>
				
					<span class="nx">sMenuCSSClassName</span> <span class="o">=</span> <span class="nx">Menu</span><span class="p">.</span><span class="nx">prototype</span><span class="p">.</span><span class="nx">CSS_CLASS_NAME</span><span class="p">;</span>
				
				<span class="p">}</span>
			
				<span class="k">if</span> <span class="p">(</span><span class="nx">p_oMenu</span> <span class="o">&amp;&amp;</span> <span class="nx">Menu</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">p_oMenu</span> <span class="k">instanceof</span> <span class="nx">Menu</span><span class="p">))</span> <span class="p">{</span>
			
					<span class="nx">oMenu</span> <span class="o">=</span> <span class="nx">p_oMenu</span><span class="p">;</span>
					<span class="nx">bInstance</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
			
					<span class="nx">initMenu</span><span class="p">.</span><span class="nx">call</span><span class="p">(</span><span class="k">this</span><span class="p">);</span>
			
				<span class="p">}</span>
				<span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="nx">Overlay</span> <span class="o">&amp;&amp;</span> <span class="nx">p_oMenu</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">p_oMenu</span> <span class="k">instanceof</span> <span class="nx">Overlay</span><span class="p">))</span> <span class="p">{</span>
			
					<span class="nx">oMenu</span> <span class="o">=</span> <span class="nx">p_oMenu</span><span class="p">;</span>
					<span class="nx">bInstance</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
			
					<span class="nx">oMenu</span><span class="p">.</span><span class="nx">cfg</span><span class="p">.</span><span class="nx">queueProperty</span><span class="p">(</span><span class="s2">&quot;visible&quot;</span><span class="p">,</span> <span class="kc">false</span><span class="p">);</span>
			
					<span class="nx">initMenu</span><span class="p">.</span><span class="nx">call</span><span class="p">(</span><span class="k">this</span><span class="p">);</span>
			
				<span class="p">}</span>
				<span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="nx">Menu</span> <span class="o">&amp;&amp;</span> <span class="nx">Lang</span><span class="p">.</span><span class="nx">isArray</span><span class="p">(</span><span class="nx">p_oMenu</span><span class="p">))</span> <span class="p">{</span>

					<span class="nx">oMenu</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">Menu</span><span class="p">(</span><span class="nx">Dom</span><span class="p">.</span><span class="nx">generateId</span><span class="p">(),</span> <span class="p">{</span> <span class="nx">lazyload</span><span class="o">:</span> <span class="nx">bLazyLoad</span><span class="p">,</span> <span class="nx">itemdata</span><span class="o">:</span> <span class="nx">p_oMenu</span> <span class="p">});</span>
						
					<span class="k">this</span><span class="p">.</span><span class="nx">_menu</span> <span class="o">=</span> <span class="nx">oMenu</span><span class="p">;</span>
			
					<span class="k">this</span><span class="p">.</span><span class="nx">on</span><span class="p">(</span><span class="s2">&quot;appendTo&quot;</span><span class="p">,</span> <span class="nx">initMenu</span><span class="p">);</span>
			
				<span class="p">}</span>
				<span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="nx">Lang</span><span class="p">.</span><span class="nx">isString</span><span class="p">(</span><span class="nx">p_oMenu</span><span class="p">))</span> <span class="p">{</span>
			
					<span class="nx">oMenuElement</span> <span class="o">=</span> <span class="nx">Dom</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="nx">p_oMenu</span><span class="p">);</span>
			
					<span class="k">if</span> <span class="p">(</span><span class="nx">oMenuElement</span><span class="p">)</span> <span class="p">{</span>
			
						<span class="k">if</span> <span class="p">(</span><span class="nx">Menu</span> <span class="o">&amp;&amp;</span> <span class="nx">Dom</span><span class="p">.</span><span class="nx">hasClass</span><span class="p">(</span><span class="nx">oMenuElement</span><span class="p">,</span> <span class="nx">sMenuCSSClassName</span><span class="p">)</span> <span class="o">||</span> 
							<span class="nx">oMenuElement</span><span class="p">.</span><span class="nx">nodeName</span><span class="p">.</span><span class="nx">toUpperCase</span><span class="p">()</span> <span class="o">==</span> <span class="s2">&quot;SELECT&quot;</span><span class="p">)</span> <span class="p">{</span>
				
							<span class="nx">oMenu</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">Menu</span><span class="p">(</span><span class="nx">p_oMenu</span><span class="p">,</span> <span class="p">{</span> <span class="nx">lazyload</span><span class="o">:</span> <span class="nx">bLazyLoad</span> <span class="p">});</span>
				
							<span class="nx">initMenu</span><span class="p">.</span><span class="nx">call</span><span class="p">(</span><span class="k">this</span><span class="p">);</span>
				
						<span class="p">}</span>
						<span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="nx">Overlay</span><span class="p">)</span> <span class="p">{</span>
			
							<span class="nx">oMenu</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">Overlay</span><span class="p">(</span><span class="nx">p_oMenu</span><span class="p">,</span> <span class="p">{</span> <span class="nx">visible</span><span class="o">:</span> <span class="kc">false</span> <span class="p">});</span>
				
							<span class="nx">initMenu</span><span class="p">.</span><span class="nx">call</span><span class="p">(</span><span class="k">this</span><span class="p">);</span>
				
						<span class="p">}</span>
			
					<span class="p">}</span>
			
				<span class="p">}</span>
				<span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="nx">p_oMenu</span> <span class="o">&amp;&amp;</span> <span class="nx">p_oMenu</span><span class="p">.</span><span class="nx">nodeName</span><span class="p">)</span> <span class="p">{</span>
			
					<span class="k">if</span> <span class="p">(</span><span class="nx">Menu</span> <span class="o">&amp;&amp;</span> <span class="nx">Dom</span><span class="p">.</span><span class="nx">hasClass</span><span class="p">(</span><span class="nx">p_oMenu</span><span class="p">,</span> <span class="nx">sMenuCSSClassName</span><span class="p">)</span> <span class="o">||</span> 
							<span class="nx">p_oMenu</span><span class="p">.</span><span class="nx">nodeName</span><span class="p">.</span><span class="nx">toUpperCase</span><span class="p">()</span> <span class="o">==</span> <span class="s2">&quot;SELECT&quot;</span><span class="p">)</span> <span class="p">{</span>
			
						<span class="nx">oMenu</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">Menu</span><span class="p">(</span><span class="nx">p_oMenu</span><span class="p">,</span> <span class="p">{</span> <span class="nx">lazyload</span><span class="o">:</span> <span class="nx">bLazyLoad</span> <span class="p">});</span>
					
						<span class="nx">initMenu</span><span class="p">.</span><span class="nx">call</span><span class="p">(</span><span class="k">this</span><span class="p">);</span>
			
					<span class="p">}</span>
					<span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="nx">Overlay</span><span class="p">)</span> <span class="p">{</span>
			
						<span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">p_oMenu</span><span class="p">.</span><span class="nx">id</span><span class="p">)</span> <span class="p">{</span>
						
							<span class="nx">Dom</span><span class="p">.</span><span class="nx">generateId</span><span class="p">(</span><span class="nx">p_oMenu</span><span class="p">);</span>
						
						<span class="p">}</span>
			
						<span class="nx">oMenu</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">Overlay</span><span class="p">(</span><span class="nx">p_oMenu</span><span class="p">,</span> <span class="p">{</span> <span class="nx">visible</span><span class="o">:</span> <span class="kc">false</span> <span class="p">});</span>
			
						<span class="nx">initMenu</span><span class="p">.</span><span class="nx">call</span><span class="p">(</span><span class="k">this</span><span class="p">);</span>
					
					<span class="p">}</span>
				
				<span class="p">}</span>
            
            <span class="p">}</span>
        
        <span class="p">},</span>
        
        
        <span class="cm">/**</span>
<span class="cm">        * @method _setOnClick</span>
<span class="cm">        * @description Sets the value of the button&#39;s &quot;onclick&quot; attribute.</span>
<span class="cm">        * @protected</span>
<span class="cm">        * @param {Object} p_oObject Object indicating the value for the button&#39;s </span>
<span class="cm">        * &quot;onclick&quot; attribute.</span>
<span class="cm">        */</span>
        <span class="nx">_setOnClick</span><span class="o">:</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">p_oObject</span><span class="p">)</span> <span class="p">{</span>
        
            <span class="cm">/*</span>
<span class="cm">                Remove any existing listeners if a &quot;click&quot; event handler </span>
<span class="cm">                has already been specified.</span>
<span class="cm">            */</span>
        
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_onclickAttributeValue</span> <span class="o">&amp;&amp;</span> 
                <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_onclickAttributeValue</span> <span class="o">!=</span> <span class="nx">p_oObject</span><span class="p">))</span> <span class="p">{</span>
        
                <span class="k">this</span><span class="p">.</span><span class="nx">removeListener</span><span class="p">(</span><span class="s2">&quot;click&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_onclickAttributeValue</span><span class="p">.</span><span class="nx">fn</span><span class="p">);</span>
        
                <span class="k">this</span><span class="p">.</span><span class="nx">_onclickAttributeValue</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>
        
            <span class="p">}</span>
        
        
            <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">_onclickAttributeValue</span> <span class="o">&amp;&amp;</span> 
                <span class="nx">Lang</span><span class="p">.</span><span class="nx">isObject</span><span class="p">(</span><span class="nx">p_oObject</span><span class="p">)</span> <span class="o">&amp;&amp;</span> 
                <span class="nx">Lang</span><span class="p">.</span><span class="nx">isFunction</span><span class="p">(</span><span class="nx">p_oObject</span><span class="p">.</span><span class="nx">fn</span><span class="p">))</span> <span class="p">{</span>
        
                <span class="k">this</span><span class="p">.</span><span class="nx">on</span><span class="p">(</span><span class="s2">&quot;click&quot;</span><span class="p">,</span> <span class="nx">p_oObject</span><span class="p">.</span><span class="nx">fn</span><span class="p">,</span> <span class="nx">p_oObject</span><span class="p">.</span><span class="nx">obj</span><span class="p">,</span> <span class="nx">p_oObject</span><span class="p">.</span><span class="nx">scope</span><span class="p">);</span>
        
                <span class="k">this</span><span class="p">.</span><span class="nx">_onclickAttributeValue</span> <span class="o">=</span> <span class="nx">p_oObject</span><span class="p">;</span>
        
            <span class="p">}</span>
        
        <span class="p">},</span>

        
        
        <span class="c1">// Protected methods</span>

        
        
        <span class="cm">/**</span>
<span class="cm">        * @method _isActivationKey</span>
<span class="cm">        * @description Determines if the specified keycode is one that toggles  </span>
<span class="cm">        * the button&#39;s &quot;active&quot; state.</span>
<span class="cm">        * @protected</span>
<span class="cm">        * @param {Number} p_nKeyCode Number representing the keycode to </span>
<span class="cm">        * be evaluated.</span>
<span class="cm">        * @return {Boolean}</span>
<span class="cm">        */</span>
        <span class="nx">_isActivationKey</span><span class="o">:</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">p_nKeyCode</span><span class="p">)</span> <span class="p">{</span>
        
            <span class="kd">var</span> <span class="nx">sType</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;type&quot;</span><span class="p">),</span>
                <span class="nx">aKeyCodes</span> <span class="o">=</span> <span class="p">(</span><span class="nx">sType</span> <span class="o">==</span> <span class="s2">&quot;checkbox&quot;</span> <span class="o">||</span> <span class="nx">sType</span> <span class="o">==</span> <span class="s2">&quot;radio&quot;</span><span class="p">)</span> <span class="o">?</span> 
                    <span class="k">this</span><span class="p">.</span><span class="nx">CHECK_ACTIVATION_KEYS</span> <span class="o">:</span> <span class="k">this</span><span class="p">.</span><span class="nx">ACTIVATION_KEYS</span><span class="p">,</span>
        
                <span class="nx">nKeyCodes</span> <span class="o">=</span> <span class="nx">aKeyCodes</span><span class="p">.</span><span class="nx">length</span><span class="p">,</span>
                <span class="nx">bReturnVal</span> <span class="o">=</span> <span class="kc">false</span><span class="p">,</span>
                <span class="nx">i</span><span class="p">;</span>
        

            <span class="k">if</span> <span class="p">(</span><span class="nx">nKeyCodes</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
        
                <span class="nx">i</span> <span class="o">=</span> <span class="nx">nKeyCodes</span> <span class="o">-</span> <span class="mi">1</span><span class="p">;</span>
        
                <span class="k">do</span> <span class="p">{</span>
        
                    <span class="k">if</span> <span class="p">(</span><span class="nx">p_nKeyCode</span> <span class="o">==</span> <span class="nx">aKeyCodes</span><span class="p">[</span><span class="nx">i</span><span class="p">])</span> <span class="p">{</span>
        
                        <span class="nx">bReturnVal</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
                        <span class="k">break</span><span class="p">;</span>
        
                    <span class="p">}</span>
        
                <span class="p">}</span>
                <span class="k">while</span> <span class="p">(</span><span class="nx">i</span><span class="o">--</span><span class="p">);</span>
            
            <span class="p">}</span>
            
            <span class="k">return</span> <span class="nx">bReturnVal</span><span class="p">;</span>
        
        <span class="p">},</span>
        
        
        <span class="cm">/**</span>
<span class="cm">        * @method _isSplitButtonOptionKey</span>
<span class="cm">        * @description Determines if the specified keycode is one that toggles  </span>
<span class="cm">        * the display of the split button&#39;s menu.</span>
<span class="cm">        * @protected</span>
<span class="cm">        * @param {Event} p_oEvent Object representing the DOM event object  </span>
<span class="cm">        * passed back by the event utility (YAHOO.util.Event).</span>
<span class="cm">        * @return {Boolean}</span>
<span class="cm">        */</span>
        <span class="nx">_isSplitButtonOptionKey</span><span class="o">:</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">p_oEvent</span><span class="p">)</span> <span class="p">{</span>

			<span class="kd">var</span> <span class="nx">bShowMenu</span> <span class="o">=</span> <span class="p">(</span><span class="nx">Event</span><span class="p">.</span><span class="nx">getCharCode</span><span class="p">(</span><span class="nx">p_oEvent</span><span class="p">)</span> <span class="o">==</span> <span class="mi">40</span><span class="p">);</span>


			<span class="kd">var</span> <span class="nx">onKeyPress</span> <span class="o">=</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">p_oEvent</span><span class="p">)</span> <span class="p">{</span>

				<span class="nx">Event</span><span class="p">.</span><span class="nx">preventDefault</span><span class="p">(</span><span class="nx">p_oEvent</span><span class="p">);</span>

				<span class="k">this</span><span class="p">.</span><span class="nx">removeListener</span><span class="p">(</span><span class="s2">&quot;keypress&quot;</span><span class="p">,</span> <span class="nx">onKeyPress</span><span class="p">);</span>
			
			<span class="p">};</span>


			<span class="c1">// Prevent the browser from scrolling the window</span>
			<span class="k">if</span> <span class="p">(</span><span class="nx">bShowMenu</span><span class="p">)</span> <span class="p">{</span>

				<span class="k">if</span> <span class="p">(</span><span class="nx">UA</span><span class="p">.</span><span class="nx">opera</span><span class="p">)</span> <span class="p">{</span>
	
					<span class="k">this</span><span class="p">.</span><span class="nx">on</span><span class="p">(</span><span class="s2">&quot;keypress&quot;</span><span class="p">,</span> <span class="nx">onKeyPress</span><span class="p">);</span>
	
				<span class="p">}</span>

				<span class="nx">Event</span><span class="p">.</span><span class="nx">preventDefault</span><span class="p">(</span><span class="nx">p_oEvent</span><span class="p">);</span>
			<span class="p">}</span>

            <span class="k">return</span> <span class="nx">bShowMenu</span><span class="p">;</span>
        
        <span class="p">},</span>
        
        
        <span class="cm">/**</span>
<span class="cm">        * @method _addListenersToForm</span>
<span class="cm">        * @description Adds event handlers to the button&#39;s form.</span>
<span class="cm">        * @protected</span>
<span class="cm">        */</span>
        <span class="nx">_addListenersToForm</span><span class="o">:</span> <span class="kd">function</span> <span class="p">()</span> <span class="p">{</span>
        
            <span class="kd">var</span> <span class="nx">oForm</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getForm</span><span class="p">(),</span>
                <span class="nx">onFormKeyPress</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">widget</span><span class="p">.</span><span class="nx">Button</span><span class="p">.</span><span class="nx">onFormKeyPress</span><span class="p">,</span>
                <span class="nx">bHasKeyPressListener</span><span class="p">,</span>
                <span class="nx">oSrcElement</span><span class="p">,</span>
                <span class="nx">aListeners</span><span class="p">,</span>
                <span class="nx">nListeners</span><span class="p">,</span>
                <span class="nx">i</span><span class="p">;</span>
        
        
            <span class="k">if</span> <span class="p">(</span><span class="nx">oForm</span><span class="p">)</span> <span class="p">{</span>
        
                <span class="nx">Event</span><span class="p">.</span><span class="nx">on</span><span class="p">(</span><span class="nx">oForm</span><span class="p">,</span> <span class="s2">&quot;reset&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_onFormReset</span><span class="p">,</span> <span class="kc">null</span><span class="p">,</span> <span class="k">this</span><span class="p">);</span>
                <span class="nx">Event</span><span class="p">.</span><span class="nx">on</span><span class="p">(</span><span class="nx">oForm</span><span class="p">,</span> <span class="s2">&quot;submit&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_onFormSubmit</span><span class="p">,</span> <span class="kc">null</span><span class="p">,</span> <span class="k">this</span><span class="p">);</span>
        
                <span class="nx">oSrcElement</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;srcelement&quot;</span><span class="p">);</span>
        
        
                <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;type&quot;</span><span class="p">)</span> <span class="o">==</span> <span class="s2">&quot;submit&quot;</span> <span class="o">||</span> 
                    <span class="p">(</span><span class="nx">oSrcElement</span> <span class="o">&amp;&amp;</span> <span class="nx">oSrcElement</span><span class="p">.</span><span class="nx">type</span> <span class="o">==</span> <span class="s2">&quot;submit&quot;</span><span class="p">))</span> 
                <span class="p">{</span>
                
                    <span class="nx">aListeners</span> <span class="o">=</span> <span class="nx">Event</span><span class="p">.</span><span class="nx">getListeners</span><span class="p">(</span><span class="nx">oForm</span><span class="p">,</span> <span class="s2">&quot;keypress&quot;</span><span class="p">);</span>
                    <span class="nx">bHasKeyPressListener</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span>
            
                    <span class="k">if</span> <span class="p">(</span><span class="nx">aListeners</span><span class="p">)</span> <span class="p">{</span>
            
                        <span class="nx">nListeners</span> <span class="o">=</span> <span class="nx">aListeners</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span>
        
                        <span class="k">if</span> <span class="p">(</span><span class="nx">nListeners</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
            
                            <span class="nx">i</span> <span class="o">=</span> <span class="nx">nListeners</span> <span class="o">-</span> <span class="mi">1</span><span class="p">;</span>
                            
                            <span class="k">do</span> <span class="p">{</span>
               
                                <span class="k">if</span> <span class="p">(</span><span class="nx">aListeners</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">fn</span> <span class="o">==</span> <span class="nx">onFormKeyPress</span><span class="p">)</span> <span class="p">{</span>
                
                                    <span class="nx">bHasKeyPressListener</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
                                    <span class="k">break</span><span class="p">;</span>
                                
                                <span class="p">}</span>
                
                            <span class="p">}</span>
                            <span class="k">while</span> <span class="p">(</span><span class="nx">i</span><span class="o">--</span><span class="p">);</span>
                        
                        <span class="p">}</span>
                    
                    <span class="p">}</span>
            
            
                    <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">bHasKeyPressListener</span><span class="p">)</span> <span class="p">{</span>
               
                        <span class="nx">Event</span><span class="p">.</span><span class="nx">on</span><span class="p">(</span><span class="nx">oForm</span><span class="p">,</span> <span class="s2">&quot;keypress&quot;</span><span class="p">,</span> <span class="nx">onFormKeyPress</span><span class="p">);</span>
            
                    <span class="p">}</span>
        
                <span class="p">}</span>
            
            <span class="p">}</span>
        
        <span class="p">},</span>
        
        
        
        <span class="cm">/**</span>
<span class="cm">        * @method _showMenu</span>
<span class="cm">        * @description Shows the button&#39;s menu.</span>
<span class="cm">        * @protected</span>
<span class="cm">        * @param {Event} p_oEvent Object representing the DOM event object </span>
<span class="cm">        * passed back by the event utility (YAHOO.util.Event) that triggered </span>
<span class="cm">        * the display of the menu.</span>
<span class="cm">        */</span>
        <span class="nx">_showMenu</span><span class="o">:</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">p_oEvent</span><span class="p">)</span> <span class="p">{</span>

            <span class="k">if</span> <span class="p">(</span><span class="nx">YAHOO</span><span class="p">.</span><span class="nx">widget</span><span class="p">.</span><span class="nx">MenuManager</span><span class="p">)</span> <span class="p">{</span>
                <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">widget</span><span class="p">.</span><span class="nx">MenuManager</span><span class="p">.</span><span class="nx">hideVisible</span><span class="p">();</span>
            <span class="p">}</span>

        
            <span class="k">if</span> <span class="p">(</span><span class="nx">m_oOverlayManager</span><span class="p">)</span> <span class="p">{</span>
                <span class="nx">m_oOverlayManager</span><span class="p">.</span><span class="nx">hideAll</span><span class="p">();</span>
            <span class="p">}</span>


            <span class="kd">var</span> <span class="nx">oMenu</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_menu</span><span class="p">,</span>
            	<span class="nx">aMenuAlignment</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;menualignment&quot;</span><span class="p">),</span>
            	<span class="nx">bFocusMenu</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;focusmenu&quot;</span><span class="p">),</span>
				<span class="nx">fnFocusMethod</span><span class="p">;</span>


			<span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_renderedMenu</span><span class="p">)</span> <span class="p">{</span>

				<span class="nx">oMenu</span><span class="p">.</span><span class="nx">cfg</span><span class="p">.</span><span class="nx">setProperty</span><span class="p">(</span><span class="s2">&quot;context&quot;</span><span class="p">,</span> 
								<span class="p">[</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;element&quot;</span><span class="p">),</span> <span class="nx">aMenuAlignment</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="nx">aMenuAlignment</span><span class="p">[</span><span class="mi">1</span><span class="p">]]);</span>
	
				<span class="nx">oMenu</span><span class="p">.</span><span class="nx">cfg</span><span class="p">.</span><span class="nx">setProperty</span><span class="p">(</span><span class="s2">&quot;preventcontextoverlap&quot;</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span>
				<span class="nx">oMenu</span><span class="p">.</span><span class="nx">cfg</span><span class="p">.</span><span class="nx">setProperty</span><span class="p">(</span><span class="s2">&quot;constraintoviewport&quot;</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span>

			<span class="p">}</span>
			<span class="k">else</span> <span class="p">{</span>

				<span class="nx">oMenu</span><span class="p">.</span><span class="nx">cfg</span><span class="p">.</span><span class="nx">queueProperty</span><span class="p">(</span><span class="s2">&quot;context&quot;</span><span class="p">,</span> 
								<span class="p">[</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;element&quot;</span><span class="p">),</span> <span class="nx">aMenuAlignment</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="nx">aMenuAlignment</span><span class="p">[</span><span class="mi">1</span><span class="p">]]);</span>
	
				<span class="nx">oMenu</span><span class="p">.</span><span class="nx">cfg</span><span class="p">.</span><span class="nx">queueProperty</span><span class="p">(</span><span class="s2">&quot;preventcontextoverlap&quot;</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span>
				<span class="nx">oMenu</span><span class="p">.</span><span class="nx">cfg</span><span class="p">.</span><span class="nx">queueProperty</span><span class="p">(</span><span class="s2">&quot;constraintoviewport&quot;</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span>
			
			<span class="p">}</span>


			<span class="cm">/*</span>
<span class="cm">				 Refocus the Button before showing its Menu in case the call to </span>
<span class="cm">				 YAHOO.widget.MenuManager.hideVisible() resulted in another element in the </span>
<span class="cm">				 DOM being focused after another Menu was hidden.</span>
<span class="cm">			*/</span>
			
			<span class="k">this</span><span class="p">.</span><span class="nx">focus</span><span class="p">();</span>


            <span class="k">if</span> <span class="p">(</span><span class="nx">Menu</span> <span class="o">&amp;&amp;</span> <span class="nx">oMenu</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">oMenu</span> <span class="k">instanceof</span> <span class="nx">Menu</span><span class="p">))</span> <span class="p">{</span>

				<span class="c1">// Since Menus automatically focus themselves when made visible, temporarily </span>
				<span class="c1">// replace the Menu focus method so that the value of the Button&#39;s &quot;focusmenu&quot;</span>
				<span class="c1">// attribute determines if the Menu should be focus when made visible.</span>

				<span class="nx">fnFocusMethod</span> <span class="o">=</span> <span class="nx">oMenu</span><span class="p">.</span><span class="nx">focus</span><span class="p">;</span>

				<span class="nx">oMenu</span><span class="p">.</span><span class="nx">focus</span> <span class="o">=</span> <span class="kd">function</span> <span class="p">()</span> <span class="p">{};</span>

				<span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_renderedMenu</span><span class="p">)</span> <span class="p">{</span>

					<span class="nx">oMenu</span><span class="p">.</span><span class="nx">cfg</span><span class="p">.</span><span class="nx">setProperty</span><span class="p">(</span><span class="s2">&quot;minscrollheight&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;menuminscrollheight&quot;</span><span class="p">));</span>
					<span class="nx">oMenu</span><span class="p">.</span><span class="nx">cfg</span><span class="p">.</span><span class="nx">setProperty</span><span class="p">(</span><span class="s2">&quot;maxheight&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;menumaxheight&quot;</span><span class="p">));</span>
				
				<span class="p">}</span>
				<span class="k">else</span> <span class="p">{</span>

					<span class="nx">oMenu</span><span class="p">.</span><span class="nx">cfg</span><span class="p">.</span><span class="nx">queueProperty</span><span class="p">(</span><span class="s2">&quot;minscrollheight&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;menuminscrollheight&quot;</span><span class="p">));</span>
					<span class="nx">oMenu</span><span class="p">.</span><span class="nx">cfg</span><span class="p">.</span><span class="nx">queueProperty</span><span class="p">(</span><span class="s2">&quot;maxheight&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;menumaxheight&quot;</span><span class="p">));</span>
				
				<span class="p">}</span>


                <span class="nx">oMenu</span><span class="p">.</span><span class="nx">show</span><span class="p">();</span>

        		<span class="nx">oMenu</span><span class="p">.</span><span class="nx">focus</span> <span class="o">=</span> <span class="nx">fnFocusMethod</span><span class="p">;</span>

				<span class="nx">oMenu</span><span class="p">.</span><span class="nx">align</span><span class="p">();</span>
        

                <span class="cm">/*</span>
<span class="cm">                    Stop the propagation of the event so that the MenuManager </span>
<span class="cm">                    doesn&#39;t blur the menu after it gets focus.</span>
<span class="cm">                */</span>
        
                <span class="k">if</span> <span class="p">(</span><span class="nx">p_oEvent</span><span class="p">.</span><span class="nx">type</span> <span class="o">==</span> <span class="s2">&quot;mousedown&quot;</span><span class="p">)</span> <span class="p">{</span>
                    <span class="nx">Event</span><span class="p">.</span><span class="nx">stopPropagation</span><span class="p">(</span><span class="nx">p_oEvent</span><span class="p">);</span>
                <span class="p">}</span>

        
                <span class="k">if</span> <span class="p">(</span><span class="nx">bFocusMenu</span><span class="p">)</span> <span class="p">{</span> 
                    <span class="nx">oMenu</span><span class="p">.</span><span class="nx">focus</span><span class="p">();</span>
                <span class="p">}</span>

            <span class="p">}</span>
            <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="nx">Overlay</span> <span class="o">&amp;&amp;</span> <span class="nx">oMenu</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">oMenu</span> <span class="k">instanceof</span> <span class="nx">Overlay</span><span class="p">))</span> <span class="p">{</span>

				<span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">_renderedMenu</span><span class="p">)</span> <span class="p">{</span>
		            <span class="nx">oMenu</span><span class="p">.</span><span class="nx">render</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;element&quot;</span><span class="p">).</span><span class="nx">parentNode</span><span class="p">);</span>
				<span class="p">}</span>

                <span class="nx">oMenu</span><span class="p">.</span><span class="nx">show</span><span class="p">();</span>
				<span class="nx">oMenu</span><span class="p">.</span><span class="nx">align</span><span class="p">();</span>

            <span class="p">}</span>
        
        <span class="p">},</span>
        
        
        <span class="cm">/**</span>
<span class="cm">        * @method _hideMenu</span>
<span class="cm">        * @description Hides the button&#39;s menu.</span>
<span class="cm">        * @protected</span>
<span class="cm">        */</span>
        <span class="nx">_hideMenu</span><span class="o">:</span> <span class="kd">function</span> <span class="p">()</span> <span class="p">{</span>
        
            <span class="kd">var</span> <span class="nx">oMenu</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_menu</span><span class="p">;</span>
        
            <span class="k">if</span> <span class="p">(</span><span class="nx">oMenu</span><span class="p">)</span> <span class="p">{</span>
        
                <span class="nx">oMenu</span><span class="p">.</span><span class="nx">hide</span><span class="p">();</span>
        
            <span class="p">}</span>
        
        <span class="p">},</span>
        
        
        
        
        <span class="c1">// Protected event handlers</span>
        
        
        <span class="cm">/**</span>
<span class="cm">        * @method _onMouseOver</span>
<span class="cm">        * @description &quot;mouseover&quot; event handler for the button.</span>
<span class="cm">        * @protected</span>
<span class="cm">        * @param {Event} p_oEvent Object representing the DOM event object  </span>
<span class="cm">        * passed back by the event utility (YAHOO.util.Event).</span>
<span class="cm">        */</span>
        <span class="nx">_onMouseOver</span><span class="o">:</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">p_oEvent</span><span class="p">)</span> <span class="p">{</span>
        
        	<span class="kd">var</span> <span class="nx">sType</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;type&quot;</span><span class="p">),</span>
        		<span class="nx">oElement</span><span class="p">,</span>
				<span class="nx">nOptionRegionX</span><span class="p">;</span>


			<span class="k">if</span> <span class="p">(</span><span class="nx">sType</span> <span class="o">===</span> <span class="s2">&quot;split&quot;</span><span class="p">)</span> <span class="p">{</span>

				<span class="nx">oElement</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;element&quot;</span><span class="p">);</span>
				<span class="nx">nOptionRegionX</span> <span class="o">=</span> 
					<span class="p">(</span><span class="nx">Dom</span><span class="p">.</span><span class="nx">getX</span><span class="p">(</span><span class="nx">oElement</span><span class="p">)</span> <span class="o">+</span> <span class="p">(</span><span class="nx">oElement</span><span class="p">.</span><span class="nx">offsetWidth</span> <span class="o">-</span> <span class="k">this</span><span class="p">.</span><span class="nx">OPTION_AREA_WIDTH</span><span class="p">));</span>
					
				<span class="k">this</span><span class="p">.</span><span class="nx">_nOptionRegionX</span> <span class="o">=</span> <span class="nx">nOptionRegionX</span><span class="p">;</span>
			
			<span class="p">}</span>
        

            <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">_hasMouseEventHandlers</span><span class="p">)</span> <span class="p">{</span>
        
				<span class="k">if</span> <span class="p">(</span><span class="nx">sType</span> <span class="o">===</span> <span class="s2">&quot;split&quot;</span><span class="p">)</span> <span class="p">{</span>
        
	        		<span class="k">this</span><span class="p">.</span><span class="nx">on</span><span class="p">(</span><span class="s2">&quot;mousemove&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_onMouseMove</span><span class="p">);</span>

        		<span class="p">}</span>

                <span class="k">this</span><span class="p">.</span><span class="nx">on</span><span class="p">(</span><span class="s2">&quot;mouseout&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_onMouseOut</span><span class="p">);</span>
        
                <span class="k">this</span><span class="p">.</span><span class="nx">_hasMouseEventHandlers</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
        
            <span class="p">}</span>
        

            <span class="k">this</span><span class="p">.</span><span class="nx">addStateCSSClasses</span><span class="p">(</span><span class="s2">&quot;hover&quot;</span><span class="p">);</span>


			<span class="k">if</span> <span class="p">(</span><span class="nx">sType</span> <span class="o">===</span> <span class="s2">&quot;split&quot;</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">Event</span><span class="p">.</span><span class="nx">getPageX</span><span class="p">(</span><span class="nx">p_oEvent</span><span class="p">)</span> <span class="o">&gt;</span> <span class="nx">nOptionRegionX</span><span class="p">))</span> <span class="p">{</span>
	
				<span class="k">this</span><span class="p">.</span><span class="nx">addStateCSSClasses</span><span class="p">(</span><span class="s2">&quot;hoveroption&quot;</span><span class="p">);</span>
	
			<span class="p">}</span>

        
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_activationButtonPressed</span><span class="p">)</span> <span class="p">{</span>
        
                <span class="k">this</span><span class="p">.</span><span class="nx">addStateCSSClasses</span><span class="p">(</span><span class="s2">&quot;active&quot;</span><span class="p">);</span>
        
            <span class="p">}</span>
        
        
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_bOptionPressed</span><span class="p">)</span> <span class="p">{</span>
        
                <span class="k">this</span><span class="p">.</span><span class="nx">addStateCSSClasses</span><span class="p">(</span><span class="s2">&quot;activeoption&quot;</span><span class="p">);</span>
            
            <span class="p">}</span>


            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_activationButtonPressed</span> <span class="o">||</span> <span class="k">this</span><span class="p">.</span><span class="nx">_bOptionPressed</span><span class="p">)</span> <span class="p">{</span>
        
                <span class="nx">Event</span><span class="p">.</span><span class="nx">removeListener</span><span class="p">(</span><span class="nb">document</span><span class="p">,</span> <span class="s2">&quot;mouseup&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_onDocumentMouseUp</span><span class="p">);</span>
        
            <span class="p">}</span>

        <span class="p">},</span>


        <span class="cm">/**</span>
<span class="cm">        * @method _onMouseMove</span>
<span class="cm">        * @description &quot;mousemove&quot; event handler for the button.</span>
<span class="cm">        * @protected</span>
<span class="cm">        * @param {Event} p_oEvent Object representing the DOM event object  </span>
<span class="cm">        * passed back by the event utility (YAHOO.util.Event).</span>
<span class="cm">        */</span>        
        <span class="nx">_onMouseMove</span><span class="o">:</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">p_oEvent</span><span class="p">)</span> <span class="p">{</span>
        
        	<span class="kd">var</span> <span class="nx">nOptionRegionX</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_nOptionRegionX</span><span class="p">;</span>
        
        	<span class="k">if</span> <span class="p">(</span><span class="nx">nOptionRegionX</span><span class="p">)</span> <span class="p">{</span>

				<span class="k">if</span> <span class="p">(</span><span class="nx">Event</span><span class="p">.</span><span class="nx">getPageX</span><span class="p">(</span><span class="nx">p_oEvent</span><span class="p">)</span> <span class="o">&gt;</span> <span class="nx">nOptionRegionX</span><span class="p">)</span> <span class="p">{</span>
					
					<span class="k">this</span><span class="p">.</span><span class="nx">addStateCSSClasses</span><span class="p">(</span><span class="s2">&quot;hoveroption&quot;</span><span class="p">);</span>
	
				<span class="p">}</span>
				<span class="k">else</span> <span class="p">{</span>

					<span class="k">this</span><span class="p">.</span><span class="nx">removeStateCSSClasses</span><span class="p">(</span><span class="s2">&quot;hoveroption&quot;</span><span class="p">);</span>
				
				<span class="p">}</span>
				
        	<span class="p">}</span>
        
        <span class="p">},</span>
        
        <span class="cm">/**</span>
<span class="cm">        * @method _onMouseOut</span>
<span class="cm">        * @description &quot;mouseout&quot; event handler for the button.</span>
<span class="cm">        * @protected</span>
<span class="cm">        * @param {Event} p_oEvent Object representing the DOM event object  </span>
<span class="cm">        * passed back by the event utility (YAHOO.util.Event).</span>
<span class="cm">        */</span>
        <span class="nx">_onMouseOut</span><span class="o">:</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">p_oEvent</span><span class="p">)</span> <span class="p">{</span>

			<span class="kd">var</span> <span class="nx">sType</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;type&quot;</span><span class="p">);</span>
        
            <span class="k">this</span><span class="p">.</span><span class="nx">removeStateCSSClasses</span><span class="p">(</span><span class="s2">&quot;hover&quot;</span><span class="p">);</span>
        

            <span class="k">if</span> <span class="p">(</span><span class="nx">sType</span> <span class="o">!=</span> <span class="s2">&quot;menu&quot;</span><span class="p">)</span> <span class="p">{</span>
        
                <span class="k">this</span><span class="p">.</span><span class="nx">removeStateCSSClasses</span><span class="p">(</span><span class="s2">&quot;active&quot;</span><span class="p">);</span>
        
            <span class="p">}</span>
        

            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_activationButtonPressed</span> <span class="o">||</span> <span class="k">this</span><span class="p">.</span><span class="nx">_bOptionPressed</span><span class="p">)</span> <span class="p">{</span>
        
                <span class="nx">Event</span><span class="p">.</span><span class="nx">on</span><span class="p">(</span><span class="nb">document</span><span class="p">,</span> <span class="s2">&quot;mouseup&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_onDocumentMouseUp</span><span class="p">,</span> <span class="kc">null</span><span class="p">,</span> <span class="k">this</span><span class="p">);</span>
        
            <span class="p">}</span>


			<span class="k">if</span> <span class="p">(</span><span class="nx">sType</span> <span class="o">===</span> <span class="s2">&quot;split&quot;</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">Event</span><span class="p">.</span><span class="nx">getPageX</span><span class="p">(</span><span class="nx">p_oEvent</span><span class="p">)</span> <span class="o">&gt;</span> <span class="k">this</span><span class="p">.</span><span class="nx">_nOptionRegionX</span><span class="p">))</span> <span class="p">{</span>
			
				<span class="k">this</span><span class="p">.</span><span class="nx">removeStateCSSClasses</span><span class="p">(</span><span class="s2">&quot;hoveroption&quot;</span><span class="p">);</span>
	
			<span class="p">}</span>
            
        <span class="p">},</span>
        
        
        <span class="cm">/**</span>
<span class="cm">        * @method _onDocumentMouseUp</span>
<span class="cm">        * @description &quot;mouseup&quot; event handler for the button.</span>
<span class="cm">        * @protected</span>
<span class="cm">        * @param {Event} p_oEvent Object representing the DOM event object  </span>
<span class="cm">        * passed back by the event utility (YAHOO.util.Event).</span>
<span class="cm">        */</span>
        <span class="nx">_onDocumentMouseUp</span><span class="o">:</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">p_oEvent</span><span class="p">)</span> <span class="p">{</span>
        
            <span class="k">this</span><span class="p">.</span><span class="nx">_activationButtonPressed</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">_bOptionPressed</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span>
        
            <span class="kd">var</span> <span class="nx">sType</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;type&quot;</span><span class="p">),</span>
                <span class="nx">oTarget</span><span class="p">,</span>
                <span class="nx">oMenuElement</span><span class="p">;</span>
        
            <span class="k">if</span> <span class="p">(</span><span class="nx">sType</span> <span class="o">==</span> <span class="s2">&quot;menu&quot;</span> <span class="o">||</span> <span class="nx">sType</span> <span class="o">==</span> <span class="s2">&quot;split&quot;</span><span class="p">)</span> <span class="p">{</span>

                <span class="nx">oTarget</span> <span class="o">=</span> <span class="nx">Event</span><span class="p">.</span><span class="nx">getTarget</span><span class="p">(</span><span class="nx">p_oEvent</span><span class="p">);</span>
                <span class="nx">oMenuElement</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_menu</span><span class="p">.</span><span class="nx">element</span><span class="p">;</span>
        
                <span class="k">if</span> <span class="p">(</span><span class="nx">oTarget</span> <span class="o">!=</span> <span class="nx">oMenuElement</span> <span class="o">&amp;&amp;</span> 
                    <span class="o">!</span><span class="nx">Dom</span><span class="p">.</span><span class="nx">isAncestor</span><span class="p">(</span><span class="nx">oMenuElement</span><span class="p">,</span> <span class="nx">oTarget</span><span class="p">))</span> <span class="p">{</span>

                    <span class="k">this</span><span class="p">.</span><span class="nx">removeStateCSSClasses</span><span class="p">((</span><span class="nx">sType</span> <span class="o">==</span> <span class="s2">&quot;menu&quot;</span> <span class="o">?</span> 
                        <span class="s2">&quot;active&quot;</span> <span class="o">:</span> <span class="s2">&quot;activeoption&quot;</span><span class="p">));</span>
            
                    <span class="k">this</span><span class="p">.</span><span class="nx">_hideMenu</span><span class="p">();</span>

                <span class="p">}</span>
        
            <span class="p">}</span>
        
            <span class="nx">Event</span><span class="p">.</span><span class="nx">removeListener</span><span class="p">(</span><span class="nb">document</span><span class="p">,</span> <span class="s2">&quot;mouseup&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_onDocumentMouseUp</span><span class="p">);</span>
        
        <span class="p">},</span>
        
        
        <span class="cm">/**</span>
<span class="cm">        * @method _onMouseDown</span>
<span class="cm">        * @description &quot;mousedown&quot; event handler for the button.</span>
<span class="cm">        * @protected</span>
<span class="cm">        * @param {Event} p_oEvent Object representing the DOM event object  </span>
<span class="cm">        * passed back by the event utility (YAHOO.util.Event).</span>
<span class="cm">        */</span>
        <span class="nx">_onMouseDown</span><span class="o">:</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">p_oEvent</span><span class="p">)</span> <span class="p">{</span>

            <span class="kd">var</span> <span class="nx">sType</span><span class="p">,</span>
            	<span class="nx">bReturnVal</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
        
        
            <span class="kd">function</span> <span class="nx">onMouseUp</span><span class="p">()</span> <span class="p">{</span>
            
                <span class="k">this</span><span class="p">.</span><span class="nx">_hideMenu</span><span class="p">();</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">removeListener</span><span class="p">(</span><span class="s2">&quot;mouseup&quot;</span><span class="p">,</span> <span class="nx">onMouseUp</span><span class="p">);</span>
            
            <span class="p">}</span>
        
        
            <span class="k">if</span> <span class="p">((</span><span class="nx">p_oEvent</span><span class="p">.</span><span class="nx">which</span> <span class="o">||</span> <span class="nx">p_oEvent</span><span class="p">.</span><span class="nx">button</span><span class="p">)</span> <span class="o">==</span> <span class="mi">1</span><span class="p">)</span> <span class="p">{</span>
        
        
                <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">hasFocus</span><span class="p">())</span> <span class="p">{</span>
                    <span class="nx">Lang</span><span class="p">.</span><span class="nx">later</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="k">this</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">focus</span><span class="p">);</span>
                    <span class="c1">//this.focus();</span>
                <span class="p">}</span>
        
        
                <span class="nx">sType</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;type&quot;</span><span class="p">);</span>
        
        
                <span class="k">if</span> <span class="p">(</span><span class="nx">sType</span> <span class="o">==</span> <span class="s2">&quot;split&quot;</span><span class="p">)</span> <span class="p">{</span>
                
                    <span class="k">if</span> <span class="p">(</span><span class="nx">Event</span><span class="p">.</span><span class="nx">getPageX</span><span class="p">(</span><span class="nx">p_oEvent</span><span class="p">)</span> <span class="o">&gt;</span> <span class="k">this</span><span class="p">.</span><span class="nx">_nOptionRegionX</span><span class="p">)</span> <span class="p">{</span>
                        
                        <span class="k">this</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;option&quot;</span><span class="p">,</span> <span class="nx">p_oEvent</span><span class="p">);</span>
						<span class="nx">bReturnVal</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span>
        
                    <span class="p">}</span>
                    <span class="k">else</span> <span class="p">{</span>
        
                        <span class="k">this</span><span class="p">.</span><span class="nx">addStateCSSClasses</span><span class="p">(</span><span class="s2">&quot;active&quot;</span><span class="p">);</span>
        
                        <span class="k">this</span><span class="p">.</span><span class="nx">_activationButtonPressed</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
        
                    <span class="p">}</span>
        
                <span class="p">}</span>
                <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="nx">sType</span> <span class="o">==</span> <span class="s2">&quot;menu&quot;</span><span class="p">)</span> <span class="p">{</span>
        
                    <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">isActive</span><span class="p">())</span> <span class="p">{</span>
        
                        <span class="k">this</span><span class="p">.</span><span class="nx">_hideMenu</span><span class="p">();</span>
        
                        <span class="k">this</span><span class="p">.</span><span class="nx">_activationButtonPressed</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span>
        
                    <span class="p">}</span>
                    <span class="k">else</span> <span class="p">{</span>
        
                        <span class="k">this</span><span class="p">.</span><span class="nx">_showMenu</span><span class="p">(</span><span class="nx">p_oEvent</span><span class="p">);</span>
        
                        <span class="k">this</span><span class="p">.</span><span class="nx">_activationButtonPressed</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
                    
                    <span class="p">}</span>
        
                <span class="p">}</span>
                <span class="k">else</span> <span class="p">{</span>
        
                    <span class="k">this</span><span class="p">.</span><span class="nx">addStateCSSClasses</span><span class="p">(</span><span class="s2">&quot;active&quot;</span><span class="p">);</span>
        
                    <span class="k">this</span><span class="p">.</span><span class="nx">_activationButtonPressed</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
                
                <span class="p">}</span>
        
        
        
                <span class="k">if</span> <span class="p">(</span><span class="nx">sType</span> <span class="o">==</span> <span class="s2">&quot;split&quot;</span> <span class="o">||</span> <span class="nx">sType</span> <span class="o">==</span> <span class="s2">&quot;menu&quot;</span><span class="p">)</span> <span class="p">{</span>

                    <span class="k">this</span><span class="p">.</span><span class="nx">_hideMenuTimer</span> <span class="o">=</span> <span class="nx">Lang</span><span class="p">.</span><span class="nx">later</span><span class="p">(</span><span class="mi">250</span><span class="p">,</span> <span class="k">this</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">on</span><span class="p">,</span> <span class="p">[</span><span class="s2">&quot;mouseup&quot;</span><span class="p">,</span> <span class="nx">onMouseUp</span><span class="p">]);</span>
        
                <span class="p">}</span>
        
            <span class="p">}</span>
            
            <span class="k">return</span> <span class="nx">bReturnVal</span><span class="p">;</span>
            
        <span class="p">},</span>
        
        
        <span class="cm">/**</span>
<span class="cm">        * @method _onMouseUp</span>
<span class="cm">        * @description &quot;mouseup&quot; event handler for the button.</span>
<span class="cm">        * @protected</span>
<span class="cm">        * @param {Event} p_oEvent Object representing the DOM event object  </span>
<span class="cm">        * passed back by the event utility (YAHOO.util.Event).</span>
<span class="cm">        */</span>
        <span class="nx">_onMouseUp</span><span class="o">:</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">p_oEvent</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">inMouseDown</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span>
        
            <span class="kd">var</span> <span class="nx">sType</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;type&quot;</span><span class="p">),</span>
            	<span class="nx">oHideMenuTimer</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_hideMenuTimer</span><span class="p">,</span>
            	<span class="nx">bReturnVal</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
        
        
            <span class="k">if</span> <span class="p">(</span><span class="nx">oHideMenuTimer</span><span class="p">)</span> <span class="p">{</span>
  
  				<span class="nx">oHideMenuTimer</span><span class="p">.</span><span class="nx">cancel</span><span class="p">();</span>
        
            <span class="p">}</span>
        
        
            <span class="k">if</span> <span class="p">(</span><span class="nx">sType</span> <span class="o">==</span> <span class="s2">&quot;checkbox&quot;</span> <span class="o">||</span> <span class="nx">sType</span> <span class="o">==</span> <span class="s2">&quot;radio&quot;</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">if</span> <span class="p">((</span><span class="nx">p_oEvent</span><span class="p">.</span><span class="nx">which</span> <span class="o">||</span> <span class="nx">p_oEvent</span><span class="p">.</span><span class="nx">button</span><span class="p">)</span> <span class="o">!=</span> <span class="mi">1</span><span class="p">)</span> <span class="p">{</span>
                    <span class="k">return</span><span class="p">;</span>
                <span class="p">}</span>

                <span class="k">this</span><span class="p">.</span><span class="nx">set</span><span class="p">(</span><span class="s2">&quot;checked&quot;</span><span class="p">,</span> <span class="o">!</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;checked&quot;</span><span class="p">)));</span>
            
            <span class="p">}</span>
        
        
            <span class="k">this</span><span class="p">.</span><span class="nx">_activationButtonPressed</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span>
            
        
            <span class="k">if</span> <span class="p">(</span><span class="nx">sType</span> <span class="o">!=</span> <span class="s2">&quot;menu&quot;</span><span class="p">)</span> <span class="p">{</span>
        
                <span class="k">this</span><span class="p">.</span><span class="nx">removeStateCSSClasses</span><span class="p">(</span><span class="s2">&quot;active&quot;</span><span class="p">);</span>
            
            <span class="p">}</span>

                
			<span class="k">if</span> <span class="p">(</span><span class="nx">sType</span> <span class="o">==</span> <span class="s2">&quot;split&quot;</span> <span class="o">&amp;&amp;</span> <span class="nx">Event</span><span class="p">.</span><span class="nx">getPageX</span><span class="p">(</span><span class="nx">p_oEvent</span><span class="p">)</span> <span class="o">&gt;</span> <span class="k">this</span><span class="p">.</span><span class="nx">_nOptionRegionX</span><span class="p">)</span> <span class="p">{</span>
				
				<span class="nx">bReturnVal</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span>

			<span class="p">}</span>

			<span class="k">return</span> <span class="nx">bReturnVal</span><span class="p">;</span>
            
        <span class="p">},</span>
        
        
        <span class="cm">/**</span>
<span class="cm">        * @method _onFocus</span>
<span class="cm">        * @description &quot;focus&quot; event handler for the button.</span>
<span class="cm">        * @protected</span>
<span class="cm">        * @param {Event} p_oEvent Object representing the DOM event object  </span>
<span class="cm">        * passed back by the event utility (YAHOO.util.Event).</span>
<span class="cm">        */</span>
        <span class="nx">_onFocus</span><span class="o">:</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">p_oEvent</span><span class="p">)</span> <span class="p">{</span>
        
            <span class="kd">var</span> <span class="nx">oElement</span><span class="p">;</span>
        
            <span class="k">this</span><span class="p">.</span><span class="nx">addStateCSSClasses</span><span class="p">(</span><span class="s2">&quot;focus&quot;</span><span class="p">);</span>
        
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_activationKeyPressed</span><span class="p">)</span> <span class="p">{</span>
        
                <span class="k">this</span><span class="p">.</span><span class="nx">addStateCSSClasses</span><span class="p">(</span><span class="s2">&quot;active&quot;</span><span class="p">);</span>
           
            <span class="p">}</span>
        
            <span class="nx">m_oFocusedButton</span> <span class="o">=</span> <span class="k">this</span><span class="p">;</span>
        
        
            <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">_hasKeyEventHandlers</span><span class="p">)</span> <span class="p">{</span>
        
                <span class="nx">oElement</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_button</span><span class="p">;</span>
        
                <span class="nx">Event</span><span class="p">.</span><span class="nx">on</span><span class="p">(</span><span class="nx">oElement</span><span class="p">,</span> <span class="s2">&quot;blur&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_onBlur</span><span class="p">,</span> <span class="kc">null</span><span class="p">,</span> <span class="k">this</span><span class="p">);</span>
                <span class="nx">Event</span><span class="p">.</span><span class="nx">on</span><span class="p">(</span><span class="nx">oElement</span><span class="p">,</span> <span class="s2">&quot;keydown&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_onKeyDown</span><span class="p">,</span> <span class="kc">null</span><span class="p">,</span> <span class="k">this</span><span class="p">);</span>
                <span class="nx">Event</span><span class="p">.</span><span class="nx">on</span><span class="p">(</span><span class="nx">oElement</span><span class="p">,</span> <span class="s2">&quot;keyup&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_onKeyUp</span><span class="p">,</span> <span class="kc">null</span><span class="p">,</span> <span class="k">this</span><span class="p">);</span>
        
                <span class="k">this</span><span class="p">.</span><span class="nx">_hasKeyEventHandlers</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
        
            <span class="p">}</span>
        
        
            <span class="k">this</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;focus&quot;</span><span class="p">,</span> <span class="nx">p_oEvent</span><span class="p">);</span>
        
        <span class="p">},</span>
        
        
        <span class="cm">/**</span>
<span class="cm">        * @method _onBlur</span>
<span class="cm">        * @description &quot;blur&quot; event handler for the button.</span>
<span class="cm">        * @protected</span>
<span class="cm">        * @param {Event} p_oEvent Object representing the DOM event object  </span>
<span class="cm">        * passed back by the event utility (YAHOO.util.Event).</span>
<span class="cm">        */</span>
        <span class="nx">_onBlur</span><span class="o">:</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">p_oEvent</span><span class="p">)</span> <span class="p">{</span>
        
            <span class="k">this</span><span class="p">.</span><span class="nx">removeStateCSSClasses</span><span class="p">(</span><span class="s2">&quot;focus&quot;</span><span class="p">);</span>
        
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;type&quot;</span><span class="p">)</span> <span class="o">!=</span> <span class="s2">&quot;menu&quot;</span><span class="p">)</span> <span class="p">{</span>
        
                <span class="k">this</span><span class="p">.</span><span class="nx">removeStateCSSClasses</span><span class="p">(</span><span class="s2">&quot;active&quot;</span><span class="p">);</span>

            <span class="p">}</span>    
        
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_activationKeyPressed</span><span class="p">)</span> <span class="p">{</span>
        
                <span class="nx">Event</span><span class="p">.</span><span class="nx">on</span><span class="p">(</span><span class="nb">document</span><span class="p">,</span> <span class="s2">&quot;keyup&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_onDocumentKeyUp</span><span class="p">,</span> <span class="kc">null</span><span class="p">,</span> <span class="k">this</span><span class="p">);</span>
        
            <span class="p">}</span>
        
        
            <span class="nx">m_oFocusedButton</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>
        
            <span class="k">this</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;blur&quot;</span><span class="p">,</span> <span class="nx">p_oEvent</span><span class="p">);</span>
           
        <span class="p">},</span>
        
        
        <span class="cm">/**</span>
<span class="cm">        * @method _onDocumentKeyUp</span>
<span class="cm">        * @description &quot;keyup&quot; event handler for the document.</span>
<span class="cm">        * @protected</span>
<span class="cm">        * @param {Event} p_oEvent Object representing the DOM event object  </span>
<span class="cm">        * passed back by the event utility (YAHOO.util.Event).</span>
<span class="cm">        */</span>
        <span class="nx">_onDocumentKeyUp</span><span class="o">:</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">p_oEvent</span><span class="p">)</span> <span class="p">{</span>
        
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_isActivationKey</span><span class="p">(</span><span class="nx">Event</span><span class="p">.</span><span class="nx">getCharCode</span><span class="p">(</span><span class="nx">p_oEvent</span><span class="p">)))</span> <span class="p">{</span>
        
                <span class="k">this</span><span class="p">.</span><span class="nx">_activationKeyPressed</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span>
                
                <span class="nx">Event</span><span class="p">.</span><span class="nx">removeListener</span><span class="p">(</span><span class="nb">document</span><span class="p">,</span> <span class="s2">&quot;keyup&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_onDocumentKeyUp</span><span class="p">);</span>
            
            <span class="p">}</span>
        
        <span class="p">},</span>
        
        
        <span class="cm">/**</span>
<span class="cm">        * @method _onKeyDown</span>
<span class="cm">        * @description &quot;keydown&quot; event handler for the button.</span>
<span class="cm">        * @protected</span>
<span class="cm">        * @param {Event} p_oEvent Object representing the DOM event object  </span>
<span class="cm">        * passed back by the event utility (YAHOO.util.Event).</span>
<span class="cm">        */</span>
        <span class="nx">_onKeyDown</span><span class="o">:</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">p_oEvent</span><span class="p">)</span> <span class="p">{</span>
        
            <span class="kd">var</span> <span class="nx">oMenu</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_menu</span><span class="p">;</span>
        
        
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;type&quot;</span><span class="p">)</span> <span class="o">==</span> <span class="s2">&quot;split&quot;</span> <span class="o">&amp;&amp;</span> 
                <span class="k">this</span><span class="p">.</span><span class="nx">_isSplitButtonOptionKey</span><span class="p">(</span><span class="nx">p_oEvent</span><span class="p">))</span> <span class="p">{</span>
        
                <span class="k">this</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;option&quot;</span><span class="p">,</span> <span class="nx">p_oEvent</span><span class="p">);</span>
        
            <span class="p">}</span>
            <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_isActivationKey</span><span class="p">(</span><span class="nx">Event</span><span class="p">.</span><span class="nx">getCharCode</span><span class="p">(</span><span class="nx">p_oEvent</span><span class="p">)))</span> <span class="p">{</span>
        
                <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;type&quot;</span><span class="p">)</span> <span class="o">==</span> <span class="s2">&quot;menu&quot;</span><span class="p">)</span> <span class="p">{</span>
        
                    <span class="k">this</span><span class="p">.</span><span class="nx">_showMenu</span><span class="p">(</span><span class="nx">p_oEvent</span><span class="p">);</span>
        
                <span class="p">}</span>
                <span class="k">else</span> <span class="p">{</span>
        
                    <span class="k">this</span><span class="p">.</span><span class="nx">_activationKeyPressed</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
                    
                    <span class="k">this</span><span class="p">.</span><span class="nx">addStateCSSClasses</span><span class="p">(</span><span class="s2">&quot;active&quot;</span><span class="p">);</span>
                
                <span class="p">}</span>
            
            <span class="p">}</span>
        
        
            <span class="k">if</span> <span class="p">(</span><span class="nx">oMenu</span> <span class="o">&amp;&amp;</span> <span class="nx">oMenu</span><span class="p">.</span><span class="nx">cfg</span><span class="p">.</span><span class="nx">getProperty</span><span class="p">(</span><span class="s2">&quot;visible&quot;</span><span class="p">)</span> <span class="o">&amp;&amp;</span> 
                <span class="nx">Event</span><span class="p">.</span><span class="nx">getCharCode</span><span class="p">(</span><span class="nx">p_oEvent</span><span class="p">)</span> <span class="o">==</span> <span class="mi">27</span><span class="p">)</span> <span class="p">{</span>
            
                <span class="nx">oMenu</span><span class="p">.</span><span class="nx">hide</span><span class="p">();</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">focus</span><span class="p">();</span>
            
            <span class="p">}</span>
        
        <span class="p">},</span>
        
        
        <span class="cm">/**</span>
<span class="cm">        * @method _onKeyUp</span>
<span class="cm">        * @description &quot;keyup&quot; event handler for the button.</span>
<span class="cm">        * @protected</span>
<span class="cm">        * @param {Event} p_oEvent Object representing the DOM event object  </span>
<span class="cm">        * passed back by the event utility (YAHOO.util.Event).</span>
<span class="cm">        */</span>
        <span class="nx">_onKeyUp</span><span class="o">:</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">p_oEvent</span><span class="p">)</span> <span class="p">{</span>
        
            <span class="kd">var</span> <span class="nx">sType</span><span class="p">;</span>
        
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_isActivationKey</span><span class="p">(</span><span class="nx">Event</span><span class="p">.</span><span class="nx">getCharCode</span><span class="p">(</span><span class="nx">p_oEvent</span><span class="p">)))</span> <span class="p">{</span>
        
                <span class="nx">sType</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;type&quot;</span><span class="p">);</span>
        
                <span class="k">if</span> <span class="p">(</span><span class="nx">sType</span> <span class="o">==</span> <span class="s2">&quot;checkbox&quot;</span> <span class="o">||</span> <span class="nx">sType</span> <span class="o">==</span> <span class="s2">&quot;radio&quot;</span><span class="p">)</span> <span class="p">{</span>
        
                    <span class="k">this</span><span class="p">.</span><span class="nx">set</span><span class="p">(</span><span class="s2">&quot;checked&quot;</span><span class="p">,</span> <span class="o">!</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;checked&quot;</span><span class="p">)));</span>
                
                <span class="p">}</span>
        
                <span class="k">this</span><span class="p">.</span><span class="nx">_activationKeyPressed</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span>
        
                <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;type&quot;</span><span class="p">)</span> <span class="o">!=</span> <span class="s2">&quot;menu&quot;</span><span class="p">)</span> <span class="p">{</span>
        
                    <span class="k">this</span><span class="p">.</span><span class="nx">removeStateCSSClasses</span><span class="p">(</span><span class="s2">&quot;active&quot;</span><span class="p">);</span>
        
                <span class="p">}</span>
        
            <span class="p">}</span>
        
        <span class="p">},</span>
        
        
        <span class="cm">/**</span>
<span class="cm">        * @method _onClick</span>
<span class="cm">        * @description &quot;click&quot; event handler for the button.</span>
<span class="cm">        * @protected</span>
<span class="cm">        * @param {Event} p_oEvent Object representing the DOM event object  </span>
<span class="cm">        * passed back by the event utility (YAHOO.util.Event).</span>
<span class="cm">        */</span>
        <span class="nx">_onClick</span><span class="o">:</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">p_oEvent</span><span class="p">)</span> <span class="p">{</span>
        
            <span class="kd">var</span> <span class="nx">sType</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;type&quot;</span><span class="p">),</span>
                <span class="nx">oForm</span><span class="p">,</span>
                <span class="nx">oSrcElement</span><span class="p">,</span>
                <span class="nx">bReturnVal</span><span class="p">;</span>
        

			<span class="k">switch</span> <span class="p">(</span><span class="nx">sType</span><span class="p">)</span> <span class="p">{</span>

			<span class="k">case</span> <span class="s2">&quot;submit&quot;</span><span class="o">:</span>

				<span class="k">if</span> <span class="p">(</span><span class="nx">p_oEvent</span><span class="p">.</span><span class="nx">returnValue</span> <span class="o">!==</span> <span class="kc">false</span><span class="p">)</span> <span class="p">{</span>

					<span class="k">this</span><span class="p">.</span><span class="nx">submitForm</span><span class="p">();</span>

				<span class="p">}</span>

				<span class="k">break</span><span class="p">;</span>

			<span class="k">case</span> <span class="s2">&quot;reset&quot;</span><span class="o">:</span>

				<span class="nx">oForm</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getForm</span><span class="p">();</span>

				<span class="k">if</span> <span class="p">(</span><span class="nx">oForm</span><span class="p">)</span> <span class="p">{</span>

					<span class="nx">oForm</span><span class="p">.</span><span class="nx">reset</span><span class="p">();</span>

				<span class="p">}</span>

				<span class="k">break</span><span class="p">;</span>


			<span class="k">case</span> <span class="s2">&quot;split&quot;</span><span class="o">:</span>

				<span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_nOptionRegionX</span> <span class="o">&gt;</span> <span class="mi">0</span> <span class="o">&amp;&amp;</span> 
						<span class="p">(</span><span class="nx">Event</span><span class="p">.</span><span class="nx">getPageX</span><span class="p">(</span><span class="nx">p_oEvent</span><span class="p">)</span> <span class="o">&gt;</span> <span class="k">this</span><span class="p">.</span><span class="nx">_nOptionRegionX</span><span class="p">))</span> <span class="p">{</span>

					<span class="nx">bReturnVal</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span>

				<span class="p">}</span>
				<span class="k">else</span> <span class="p">{</span>

					<span class="k">this</span><span class="p">.</span><span class="nx">_hideMenu</span><span class="p">();</span>

					<span class="nx">oSrcElement</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;srcelement&quot;</span><span class="p">);</span>

					<span class="k">if</span> <span class="p">(</span><span class="nx">oSrcElement</span> <span class="o">&amp;&amp;</span> <span class="nx">oSrcElement</span><span class="p">.</span><span class="nx">type</span> <span class="o">==</span> <span class="s2">&quot;submit&quot;</span> <span class="o">&amp;&amp;</span> 
							<span class="nx">p_oEvent</span><span class="p">.</span><span class="nx">returnValue</span> <span class="o">!==</span> <span class="kc">false</span><span class="p">)</span> <span class="p">{</span>

						<span class="k">this</span><span class="p">.</span><span class="nx">submitForm</span><span class="p">();</span>

					<span class="p">}</span>

				<span class="p">}</span>

				<span class="k">break</span><span class="p">;</span>

			<span class="p">}</span>

			<span class="k">return</span> <span class="nx">bReturnVal</span><span class="p">;</span>
        
        <span class="p">},</span>
        
        
        <span class="cm">/**</span>
<span class="cm">        * @method _onDblClick</span>
<span class="cm">        * @description &quot;dblclick&quot; event handler for the button.</span>
<span class="cm">        * @protected</span>
<span class="cm">        * @param {Event} p_oEvent Object representing the DOM event object  </span>
<span class="cm">        * passed back by the event utility (YAHOO.util.Event).</span>
<span class="cm">        */</span>
        <span class="nx">_onDblClick</span><span class="o">:</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">p_oEvent</span><span class="p">)</span> <span class="p">{</span>
        
            <span class="kd">var</span> <span class="nx">bReturnVal</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
    
			<span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;type&quot;</span><span class="p">)</span> <span class="o">==</span> <span class="s2">&quot;split&quot;</span> <span class="o">&amp;&amp;</span> <span class="nx">Event</span><span class="p">.</span><span class="nx">getPageX</span><span class="p">(</span><span class="nx">p_oEvent</span><span class="p">)</span> <span class="o">&gt;</span> <span class="k">this</span><span class="p">.</span><span class="nx">_nOptionRegionX</span><span class="p">)</span> <span class="p">{</span>

				<span class="nx">bReturnVal</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span>
			
			<span class="p">}</span>
        
        	<span class="k">return</span> <span class="nx">bReturnVal</span><span class="p">;</span>
        
        <span class="p">},</span>        
        
        
        <span class="cm">/**</span>
<span class="cm">        * @method _onAppendTo</span>
<span class="cm">        * @description &quot;appendTo&quot; event handler for the button.</span>
<span class="cm">        * @protected</span>
<span class="cm">        * @param {Event} p_oEvent Object representing the DOM event object  </span>
<span class="cm">        * passed back by the event utility (YAHOO.util.Event).</span>
<span class="cm">        */</span>
        <span class="nx">_onAppendTo</span><span class="o">:</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">p_oEvent</span><span class="p">)</span> <span class="p">{</span>
        
            <span class="cm">/*</span>
<span class="cm">                It is necessary to call &quot;_addListenersToForm&quot; using </span>
<span class="cm">                &quot;setTimeout&quot; to make sure that the button&#39;s &quot;form&quot; property </span>
<span class="cm">                returns a node reference.  Sometimes, if you try to get the </span>
<span class="cm">                reference immediately after appending the field, it is null.</span>
<span class="cm">            */</span>
        
            <span class="nx">Lang</span><span class="p">.</span><span class="nx">later</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="k">this</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_addListenersToForm</span><span class="p">);</span>
        
        <span class="p">},</span>
        
        
        <span class="cm">/**</span>
<span class="cm">        * @method _onFormReset</span>
<span class="cm">        * @description &quot;reset&quot; event handler for the button&#39;s form.</span>
<span class="cm">        * @protected</span>
<span class="cm">        * @param {Event} p_oEvent Object representing the DOM event </span>
<span class="cm">        * object passed back by the event utility (YAHOO.util.Event).</span>
<span class="cm">        */</span>
        <span class="nx">_onFormReset</span><span class="o">:</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">p_oEvent</span><span class="p">)</span> <span class="p">{</span>
        
            <span class="kd">var</span> <span class="nx">sType</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;type&quot;</span><span class="p">),</span>
                <span class="nx">oMenu</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_menu</span><span class="p">;</span>
        
            <span class="k">if</span> <span class="p">(</span><span class="nx">sType</span> <span class="o">==</span> <span class="s2">&quot;checkbox&quot;</span> <span class="o">||</span> <span class="nx">sType</span> <span class="o">==</span> <span class="s2">&quot;radio&quot;</span><span class="p">)</span> <span class="p">{</span>
        
                <span class="k">this</span><span class="p">.</span><span class="nx">resetValue</span><span class="p">(</span><span class="s2">&quot;checked&quot;</span><span class="p">);</span>
        
            <span class="p">}</span>
        
        
            <span class="k">if</span> <span class="p">(</span><span class="nx">Menu</span> <span class="o">&amp;&amp;</span> <span class="nx">oMenu</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">oMenu</span> <span class="k">instanceof</span> <span class="nx">Menu</span><span class="p">))</span> <span class="p">{</span>
        
                <span class="k">this</span><span class="p">.</span><span class="nx">resetValue</span><span class="p">(</span><span class="s2">&quot;selectedMenuItem&quot;</span><span class="p">);</span>
        
            <span class="p">}</span>
        
        <span class="p">},</span>


        <span class="cm">/**</span>
<span class="cm">        * @method _onFormSubmit</span>
<span class="cm">        * @description &quot;submit&quot; event handler for the button&#39;s form.</span>
<span class="cm">        * @protected</span>
<span class="cm">        * @param {Event} p_oEvent Object representing the DOM event </span>
<span class="cm">        * object passed back by the event utility (YAHOO.util.Event).</span>
<span class="cm">        */</span>        
        <span class="nx">_onFormSubmit</span><span class="o">:</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">p_oEvent</span><span class="p">)</span> <span class="p">{</span>
        
        	<span class="k">this</span><span class="p">.</span><span class="nx">createHiddenFields</span><span class="p">();</span>
        
        <span class="p">},</span>
        
        
        <span class="cm">/**</span>
<span class="cm">        * @method _onDocumentMouseDown</span>
<span class="cm">        * @description &quot;mousedown&quot; event handler for the document.</span>
<span class="cm">        * @protected</span>
<span class="cm">        * @param {Event} p_oEvent Object representing the DOM event object  </span>
<span class="cm">        * passed back by the event utility (YAHOO.util.Event).</span>
<span class="cm">        */</span>
        <span class="nx">_onDocumentMouseDown</span><span class="o">:</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">p_oEvent</span><span class="p">)</span> <span class="p">{</span>

            <span class="kd">var</span> <span class="nx">oTarget</span> <span class="o">=</span> <span class="nx">Event</span><span class="p">.</span><span class="nx">getTarget</span><span class="p">(</span><span class="nx">p_oEvent</span><span class="p">),</span>
                <span class="nx">oButtonElement</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;element&quot;</span><span class="p">),</span>
                <span class="nx">oMenuElement</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_menu</span><span class="p">.</span><span class="nx">element</span><span class="p">;</span>
           
            <span class="kd">function</span> <span class="nx">findTargetInSubmenus</span><span class="p">(</span><span class="nx">aSubmenus</span><span class="p">)</span> <span class="p">{</span>
                <span class="kd">var</span> <span class="nx">i</span><span class="p">,</span> <span class="nx">iMax</span><span class="p">,</span> <span class="nx">oSubmenuElement</span><span class="p">;</span>
                <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">aSubmenus</span><span class="p">)</span> <span class="p">{</span>
                    <span class="k">return</span> <span class="kc">true</span><span class="p">;</span>
                <span class="p">}</span>
                <span class="k">for</span> <span class="p">(</span><span class="nx">i</span> <span class="o">=</span> <span class="mi">0</span><span class="p">,</span> <span class="nx">iMax</span> <span class="o">=</span> <span class="nx">aSubmenus</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">i</span> <span class="o">&lt;</span> <span class="nx">iMax</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                    <span class="nx">oSubmenuElement</span> <span class="o">=</span> <span class="nx">aSubmenus</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">element</span><span class="p">;</span>
                    <span class="k">if</span> <span class="p">(</span><span class="nx">oTarget</span> <span class="o">==</span> <span class="nx">oSubmenuElement</span> <span class="o">||</span> <span class="nx">Dom</span><span class="p">.</span><span class="nx">isAncestor</span><span class="p">(</span><span class="nx">oSubmenuElement</span><span class="p">,</span> <span class="nx">oTarget</span><span class="p">))</span> <span class="p">{</span>
                        <span class="k">return</span> <span class="kc">true</span><span class="p">;</span>
                    <span class="p">}</span>
                    <span class="k">if</span> <span class="p">(</span><span class="nx">aSubmenus</span><span class="p">[</span><span class="nx">i</span><span class="p">]</span> <span class="o">&amp;&amp;</span> <span class="nx">aSubmenus</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">getSubmenus</span><span class="p">)</span> <span class="p">{</span>
                        <span class="k">if</span> <span class="p">(</span><span class="nx">findTargetInSubmenus</span><span class="p">(</span><span class="nx">aSubmenus</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">getSubmenus</span><span class="p">()))</span> <span class="p">{</span>
                            <span class="k">return</span> <span class="kc">true</span><span class="p">;</span>
                        <span class="p">}</span>
                    <span class="p">}</span>
                <span class="p">}</span>
        
                <span class="k">return</span> <span class="kc">false</span><span class="p">;</span>
            <span class="p">}</span>

            <span class="k">if</span> <span class="p">(</span><span class="nx">oTarget</span> <span class="o">!=</span> <span class="nx">oButtonElement</span> <span class="o">&amp;&amp;</span> 
                <span class="o">!</span><span class="nx">Dom</span><span class="p">.</span><span class="nx">isAncestor</span><span class="p">(</span><span class="nx">oButtonElement</span><span class="p">,</span> <span class="nx">oTarget</span><span class="p">)</span> <span class="o">&amp;&amp;</span> 
                <span class="nx">oTarget</span> <span class="o">!=</span> <span class="nx">oMenuElement</span> <span class="o">&amp;&amp;</span> 
                <span class="o">!</span><span class="nx">Dom</span><span class="p">.</span><span class="nx">isAncestor</span><span class="p">(</span><span class="nx">oMenuElement</span><span class="p">,</span> <span class="nx">oTarget</span><span class="p">))</span> <span class="p">{</span>
                
                
                <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_menu</span>  <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="p">.</span><span class="nx">_menu</span><span class="p">.</span><span class="nx">getSubmenus</span><span class="p">)</span> <span class="p">{</span>
                    <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">findTargetInSubmenus</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_menu</span><span class="p">.</span><span class="nx">getSubmenus</span><span class="p">()))</span> <span class="p">{</span>
                        <span class="k">return</span><span class="p">;</span>
                    <span class="p">}</span>
                <span class="p">}</span>
                

                <span class="k">this</span><span class="p">.</span><span class="nx">_hideMenu</span><span class="p">();</span>

				<span class="c1">//	In IE when the user mouses down on a focusable element</span>
				<span class="c1">//	that element will be focused and become the &quot;activeElement&quot;.</span>
				<span class="c1">//	(http://msdn.microsoft.com/en-us/library/ms533065(VS.85).aspx)</span>
				<span class="c1">//	However, there is a bug in IE where if there is a  </span>
				<span class="c1">//	positioned element with a focused descendant that is </span>
				<span class="c1">//	hidden in response to the mousedown event, the target of </span>
				<span class="c1">//	the mousedown event will appear to have focus, but will </span>
				<span class="c1">//	not be set as the activeElement.  This will result </span>
				<span class="c1">//	in the element not firing key events, even though it</span>
				<span class="c1">//	appears to have focus.	The following call to &quot;setActive&quot;</span>
				<span class="c1">//	fixes this bug.</span>

                <span class="k">if</span> <span class="p">(</span><span class="nx">UA</span><span class="p">.</span><span class="nx">ie</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">UA</span><span class="p">.</span><span class="nx">ie</span> <span class="o">&lt;</span> <span class="mi">9</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="nx">oTarget</span><span class="p">.</span><span class="nx">focus</span><span class="p">)</span> <span class="p">{</span>
					<span class="nx">oTarget</span><span class="p">.</span><span class="nx">setActive</span><span class="p">();</span>
				<span class="p">}</span>
        
                <span class="nx">Event</span><span class="p">.</span><span class="nx">removeListener</span><span class="p">(</span><span class="nb">document</span><span class="p">,</span> <span class="s2">&quot;mousedown&quot;</span><span class="p">,</span> 
                    <span class="k">this</span><span class="p">.</span><span class="nx">_onDocumentMouseDown</span><span class="p">);</span>    
            
            <span class="p">}</span>
        
        <span class="p">},</span>
        
        
        <span class="cm">/**</span>
<span class="cm">        * @method _onOption</span>
<span class="cm">        * @description &quot;option&quot; event handler for the button.</span>
<span class="cm">        * @protected</span>
<span class="cm">        * @param {Event} p_oEvent Object representing the DOM event object  </span>
<span class="cm">        * passed back by the event utility (YAHOO.util.Event).</span>
<span class="cm">        */</span>
        <span class="nx">_onOption</span><span class="o">:</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">p_oEvent</span><span class="p">)</span> <span class="p">{</span>
        
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">hasClass</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">CLASS_NAME_PREFIX</span> <span class="o">+</span> <span class="s2">&quot;split-button-activeoption&quot;</span><span class="p">))</span> <span class="p">{</span>
        
                <span class="k">this</span><span class="p">.</span><span class="nx">_hideMenu</span><span class="p">();</span>
        
                <span class="k">this</span><span class="p">.</span><span class="nx">_bOptionPressed</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span>
        
            <span class="p">}</span>
            <span class="k">else</span> <span class="p">{</span>
        
                <span class="k">this</span><span class="p">.</span><span class="nx">_showMenu</span><span class="p">(</span><span class="nx">p_oEvent</span><span class="p">);</span>    
        
                <span class="k">this</span><span class="p">.</span><span class="nx">_bOptionPressed</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
        
            <span class="p">}</span>
        
        <span class="p">},</span>
        
        
        <span class="cm">/**</span>
<span class="cm">        * @method _onMenuShow</span>
<span class="cm">        * @description &quot;show&quot; event handler for the button&#39;s menu.</span>
<span class="cm">        * @private</span>
<span class="cm">        * @param {String} p_sType String representing the name of the event  </span>
<span class="cm">        * that was fired.</span>
<span class="cm">        */</span>
        <span class="nx">_onMenuShow</span><span class="o">:</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">p_sType</span><span class="p">)</span> <span class="p">{</span>
        
            <span class="nx">Event</span><span class="p">.</span><span class="nx">on</span><span class="p">(</span><span class="nb">document</span><span class="p">,</span> <span class="s2">&quot;mousedown&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_onDocumentMouseDown</span><span class="p">,</span> 
                <span class="kc">null</span><span class="p">,</span> <span class="k">this</span><span class="p">);</span>
        
            <span class="kd">var</span> <span class="nx">sState</span> <span class="o">=</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;type&quot;</span><span class="p">)</span> <span class="o">==</span> <span class="s2">&quot;split&quot;</span><span class="p">)</span> <span class="o">?</span> <span class="s2">&quot;activeoption&quot;</span> <span class="o">:</span> <span class="s2">&quot;active&quot;</span><span class="p">;</span>
        
            <span class="k">this</span><span class="p">.</span><span class="nx">addStateCSSClasses</span><span class="p">(</span><span class="nx">sState</span><span class="p">);</span>
        
        <span class="p">},</span>
        
        
        <span class="cm">/**</span>
<span class="cm">        * @method _onMenuHide</span>
<span class="cm">        * @description &quot;hide&quot; event handler for the button&#39;s menu.</span>
<span class="cm">        * @private</span>
<span class="cm">        * @param {String} p_sType String representing the name of the event  </span>
<span class="cm">        * that was fired.</span>
<span class="cm">        */</span>
        <span class="nx">_onMenuHide</span><span class="o">:</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">p_sType</span><span class="p">)</span> <span class="p">{</span>
            
            <span class="kd">var</span> <span class="nx">sState</span> <span class="o">=</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;type&quot;</span><span class="p">)</span> <span class="o">==</span> <span class="s2">&quot;split&quot;</span><span class="p">)</span> <span class="o">?</span> <span class="s2">&quot;activeoption&quot;</span> <span class="o">:</span> <span class="s2">&quot;active&quot;</span><span class="p">;</span>
        
            <span class="k">this</span><span class="p">.</span><span class="nx">removeStateCSSClasses</span><span class="p">(</span><span class="nx">sState</span><span class="p">);</span>
        
        
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;type&quot;</span><span class="p">)</span> <span class="o">==</span> <span class="s2">&quot;split&quot;</span><span class="p">)</span> <span class="p">{</span>
        
                <span class="k">this</span><span class="p">.</span><span class="nx">_bOptionPressed</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span>
            
            <span class="p">}</span>
        
        <span class="p">},</span>
        
        
        <span class="cm">/**</span>
<span class="cm">        * @method _onMenuKeyDown</span>
<span class="cm">        * @description &quot;keydown&quot; event handler for the button&#39;s menu.</span>
<span class="cm">        * @private</span>
<span class="cm">        * @param {String} p_sType String representing the name of the event  </span>
<span class="cm">        * that was fired.</span>
<span class="cm">        * @param {Array} p_aArgs Array of arguments sent when the event </span>
<span class="cm">        * was fired.</span>
<span class="cm">        */</span>
        <span class="nx">_onMenuKeyDown</span><span class="o">:</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">p_sType</span><span class="p">,</span> <span class="nx">p_aArgs</span><span class="p">)</span> <span class="p">{</span>
        
            <span class="kd">var</span> <span class="nx">oEvent</span> <span class="o">=</span> <span class="nx">p_aArgs</span><span class="p">[</span><span class="mi">0</span><span class="p">];</span>
        
            <span class="k">if</span> <span class="p">(</span><span class="nx">Event</span><span class="p">.</span><span class="nx">getCharCode</span><span class="p">(</span><span class="nx">oEvent</span><span class="p">)</span> <span class="o">==</span> <span class="mi">27</span><span class="p">)</span> <span class="p">{</span>
        
                <span class="k">this</span><span class="p">.</span><span class="nx">focus</span><span class="p">();</span>
        
                <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;type&quot;</span><span class="p">)</span> <span class="o">==</span> <span class="s2">&quot;split&quot;</span><span class="p">)</span> <span class="p">{</span>
                
                    <span class="k">this</span><span class="p">.</span><span class="nx">_bOptionPressed</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span>
                
                <span class="p">}</span>
        
            <span class="p">}</span>
        
        <span class="p">},</span>
        
        
        <span class="cm">/**</span>
<span class="cm">        * @method _onMenuRender</span>
<span class="cm">        * @description &quot;render&quot; event handler for the button&#39;s menu.</span>
<span class="cm">        * @private</span>
<span class="cm">        * @param {String} p_sType String representing the name of the  </span>
<span class="cm">        * event thatwas fired.</span>
<span class="cm">        */</span>
        <span class="nx">_onMenuRender</span><span class="o">:</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">p_sType</span><span class="p">)</span> <span class="p">{</span>
        
            <span class="kd">var</span> <span class="nx">oButtonElement</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;element&quot;</span><span class="p">),</span>
                <span class="nx">oButtonParent</span> <span class="o">=</span> <span class="nx">oButtonElement</span><span class="p">.</span><span class="nx">parentNode</span><span class="p">,</span>
				<span class="nx">oMenu</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_menu</span><span class="p">,</span>
                <span class="nx">oMenuElement</span> <span class="o">=</span> <span class="nx">oMenu</span><span class="p">.</span><span class="nx">element</span><span class="p">,</span>
				<span class="nx">oSrcElement</span> <span class="o">=</span> <span class="nx">oMenu</span><span class="p">.</span><span class="nx">srcElement</span><span class="p">,</span>
				<span class="nx">oItem</span><span class="p">;</span>
        
        
            <span class="k">if</span> <span class="p">(</span><span class="nx">oButtonParent</span> <span class="o">!=</span> <span class="nx">oMenuElement</span><span class="p">.</span><span class="nx">parentNode</span><span class="p">)</span> <span class="p">{</span>
        
                <span class="nx">oButtonParent</span><span class="p">.</span><span class="nx">appendChild</span><span class="p">(</span><span class="nx">oMenuElement</span><span class="p">);</span>
            
            <span class="p">}</span>

			<span class="k">this</span><span class="p">.</span><span class="nx">_renderedMenu</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>

			<span class="c1">//	If the user has designated an &lt;option&gt; of the Menu&#39;s source </span>
			<span class="c1">//	&lt;select&gt; element to be selected, sync the selectedIndex with </span>
			<span class="c1">//	the &quot;selectedMenuItem&quot; Attribute.</span>

			<span class="k">if</span> <span class="p">(</span><span class="nx">oSrcElement</span> <span class="o">&amp;&amp;</span> 
					<span class="nx">oSrcElement</span><span class="p">.</span><span class="nx">nodeName</span><span class="p">.</span><span class="nx">toLowerCase</span><span class="p">()</span> <span class="o">===</span> <span class="s2">&quot;select&quot;</span> <span class="o">&amp;&amp;</span> 
					<span class="nx">oSrcElement</span><span class="p">.</span><span class="nx">value</span><span class="p">)</span> <span class="p">{</span>
				
				
				<span class="nx">oItem</span> <span class="o">=</span> <span class="nx">oMenu</span><span class="p">.</span><span class="nx">getItem</span><span class="p">(</span><span class="nx">oSrcElement</span><span class="p">.</span><span class="nx">selectedIndex</span><span class="p">);</span>
				
				<span class="c1">//	Set the value of the &quot;selectedMenuItem&quot; attribute</span>
				<span class="c1">//	silently since this is the initial set--synchronizing </span>
				<span class="c1">//	the value of the source &lt;SELECT&gt; element in the DOM with </span>
				<span class="c1">//	its corresponding Menu instance.</span>

				<span class="k">this</span><span class="p">.</span><span class="nx">set</span><span class="p">(</span><span class="s2">&quot;selectedMenuItem&quot;</span><span class="p">,</span> <span class="nx">oItem</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span>
				
				<span class="c1">//	Call the &quot;_onSelectedMenuItemChange&quot; method since the </span>
				<span class="c1">//	attribute was set silently.</span>

				<span class="k">this</span><span class="p">.</span><span class="nx">_onSelectedMenuItemChange</span><span class="p">({</span> <span class="nx">newValue</span><span class="o">:</span> <span class="nx">oItem</span> <span class="p">});</span>
				
			<span class="p">}</span>

        <span class="p">},</span>

        
        
        <span class="cm">/**</span>
<span class="cm">        * @method _onMenuClick</span>
<span class="cm">        * @description &quot;click&quot; event handler for the button&#39;s menu.</span>
<span class="cm">        * @private</span>
<span class="cm">        * @param {String} p_sType String representing the name of the event  </span>
<span class="cm">        * that was fired.</span>
<span class="cm">        * @param {Array} p_aArgs Array of arguments sent when the event </span>
<span class="cm">        * was fired.</span>
<span class="cm">        */</span>
        <span class="nx">_onMenuClick</span><span class="o">:</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">p_sType</span><span class="p">,</span> <span class="nx">p_aArgs</span><span class="p">)</span> <span class="p">{</span>

            <span class="kd">var</span> <span class="nx">oItem</span> <span class="o">=</span> <span class="nx">p_aArgs</span><span class="p">[</span><span class="mi">1</span><span class="p">],</span>
                <span class="nx">oSrcElement</span><span class="p">;</span>
        
            <span class="k">if</span> <span class="p">(</span><span class="nx">oItem</span><span class="p">)</span> <span class="p">{</span>
        
				<span class="k">this</span><span class="p">.</span><span class="nx">set</span><span class="p">(</span><span class="s2">&quot;selectedMenuItem&quot;</span><span class="p">,</span> <span class="nx">oItem</span><span class="p">);</span>

                <span class="nx">oSrcElement</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;srcelement&quot;</span><span class="p">);</span>
            
                <span class="k">if</span> <span class="p">(</span><span class="nx">oSrcElement</span> <span class="o">&amp;&amp;</span> <span class="nx">oSrcElement</span><span class="p">.</span><span class="nx">type</span> <span class="o">==</span> <span class="s2">&quot;submit&quot;</span><span class="p">)</span> <span class="p">{</span>
        
                    <span class="k">this</span><span class="p">.</span><span class="nx">submitForm</span><span class="p">();</span>
            
                <span class="p">}</span>
            
                <span class="k">this</span><span class="p">.</span><span class="nx">_hideMenu</span><span class="p">();</span>
            
            <span class="p">}</span>
        
        <span class="p">},</span>


        <span class="cm">/**</span>
<span class="cm">        * @method _onSelectedMenuItemChange</span>
<span class="cm">        * @description &quot;selectedMenuItemChange&quot; event handler for the Button&#39;s</span>
<span class="cm">		* &quot;selectedMenuItem&quot; attribute.</span>
<span class="cm">        * @param {Event} event Object representing the DOM event object  </span>
<span class="cm">        * passed back by the event utility (YAHOO.util.Event).</span>
<span class="cm">        */</span>
		<span class="nx">_onSelectedMenuItemChange</span><span class="o">:</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">event</span><span class="p">)</span> <span class="p">{</span>
		
			<span class="kd">var</span> <span class="nx">oSelected</span> <span class="o">=</span> <span class="nx">event</span><span class="p">.</span><span class="nx">prevValue</span><span class="p">,</span>
				<span class="nx">oItem</span> <span class="o">=</span> <span class="nx">event</span><span class="p">.</span><span class="nx">newValue</span><span class="p">,</span>
				<span class="nx">sPrefix</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">CLASS_NAME_PREFIX</span><span class="p">;</span>

			<span class="k">if</span> <span class="p">(</span><span class="nx">oSelected</span><span class="p">)</span> <span class="p">{</span>
				<span class="nx">Dom</span><span class="p">.</span><span class="nx">removeClass</span><span class="p">(</span><span class="nx">oSelected</span><span class="p">.</span><span class="nx">element</span><span class="p">,</span> <span class="p">(</span><span class="nx">sPrefix</span> <span class="o">+</span> <span class="s2">&quot;button-selectedmenuitem&quot;</span><span class="p">));</span>
			<span class="p">}</span>
			
			<span class="k">if</span> <span class="p">(</span><span class="nx">oItem</span><span class="p">)</span> <span class="p">{</span>
				<span class="nx">Dom</span><span class="p">.</span><span class="nx">addClass</span><span class="p">(</span><span class="nx">oItem</span><span class="p">.</span><span class="nx">element</span><span class="p">,</span> <span class="p">(</span><span class="nx">sPrefix</span> <span class="o">+</span> <span class="s2">&quot;button-selectedmenuitem&quot;</span><span class="p">));</span>
			<span class="p">}</span>
			
		<span class="p">},</span>        
        

        <span class="cm">/**</span>
<span class="cm">        * @method _onLabelClick</span>
<span class="cm">        * @description &quot;click&quot; event handler for the Button&#39;s</span>
<span class="cm">		* &lt;code&gt;&amp;#60;label&amp;#62;&lt;/code&gt; element.</span>
<span class="cm">        * @param {Event} event Object representing the DOM event object  </span>
<span class="cm">        * passed back by the event utility (YAHOO.util.Event).</span>
<span class="cm">        */</span>
		<span class="nx">_onLabelClick</span><span class="o">:</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">event</span><span class="p">)</span> <span class="p">{</span>

			<span class="k">this</span><span class="p">.</span><span class="nx">focus</span><span class="p">();</span>

			<span class="kd">var</span> <span class="nx">sType</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;type&quot;</span><span class="p">);</span>

			<span class="k">if</span> <span class="p">(</span><span class="nx">sType</span> <span class="o">==</span> <span class="s2">&quot;radio&quot;</span> <span class="o">||</span> <span class="nx">sType</span> <span class="o">==</span> <span class="s2">&quot;checkbox&quot;</span><span class="p">)</span> <span class="p">{</span>
				<span class="k">this</span><span class="p">.</span><span class="nx">set</span><span class="p">(</span><span class="s2">&quot;checked&quot;</span><span class="p">,</span> <span class="p">(</span><span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;checked&quot;</span><span class="p">)));</span>						
			<span class="p">}</span>
			
		<span class="p">},</span>

        
        <span class="c1">// Public methods</span>
        
        
        <span class="cm">/**</span>
<span class="cm">        * @method createButtonElement</span>
<span class="cm">        * @description Creates the button&#39;s HTML elements.</span>
<span class="cm">        * @param {String} p_sType String indicating the type of element </span>
<span class="cm">        * to create.</span>
<span class="cm">        * @return {&lt;a href=&quot;http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/</span>
<span class="cm">        * level-one-html.html#ID-58190037&quot;&gt;HTMLElement&lt;/a&gt;}</span>
<span class="cm">        */</span>
        <span class="nx">createButtonElement</span><span class="o">:</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">p_sType</span><span class="p">)</span> <span class="p">{</span>
        
            <span class="kd">var</span> <span class="nx">sNodeName</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">NODE_NAME</span><span class="p">,</span>
                <span class="nx">oElement</span> <span class="o">=</span> <span class="nb">document</span><span class="p">.</span><span class="nx">createElement</span><span class="p">(</span><span class="nx">sNodeName</span><span class="p">);</span>
        
            <span class="nx">oElement</span><span class="p">.</span><span class="nx">innerHTML</span> <span class="o">=</span>  <span class="s2">&quot;&lt;&quot;</span> <span class="o">+</span> <span class="nx">sNodeName</span> <span class="o">+</span> <span class="s2">&quot; class=\&quot;first-child\&quot;&gt;&quot;</span> <span class="o">+</span> 
                <span class="p">(</span><span class="nx">p_sType</span> <span class="o">==</span> <span class="s2">&quot;link&quot;</span> <span class="o">?</span> <span class="s2">&quot;&lt;a&gt;&lt;/a&gt;&quot;</span> <span class="o">:</span> 
                <span class="s2">&quot;&lt;button type=\&quot;button\&quot;&gt;&lt;/button&gt;&quot;</span><span class="p">)</span> <span class="o">+</span> <span class="s2">&quot;&lt;/&quot;</span> <span class="o">+</span> <span class="nx">sNodeName</span> <span class="o">+</span> <span class="s2">&quot;&gt;&quot;</span><span class="p">;</span>
        
            <span class="k">return</span> <span class="nx">oElement</span><span class="p">;</span>
        
        <span class="p">},</span>

        
        <span class="cm">/**</span>
<span class="cm">        * @method addStateCSSClasses</span>
<span class="cm">        * @description Appends state-specific CSS classes to the button&#39;s root </span>
<span class="cm">        * DOM element.</span>
<span class="cm">        */</span>
        <span class="nx">addStateCSSClasses</span><span class="o">:</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">p_sState</span><span class="p">)</span> <span class="p">{</span>
        
            <span class="kd">var</span> <span class="nx">sType</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;type&quot;</span><span class="p">),</span>
				<span class="nx">sPrefix</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">CLASS_NAME_PREFIX</span><span class="p">;</span>
        
            <span class="k">if</span> <span class="p">(</span><span class="nx">Lang</span><span class="p">.</span><span class="nx">isString</span><span class="p">(</span><span class="nx">p_sState</span><span class="p">))</span> <span class="p">{</span>
        
                <span class="k">if</span> <span class="p">(</span><span class="nx">p_sState</span> <span class="o">!=</span> <span class="s2">&quot;activeoption&quot;</span> <span class="o">&amp;&amp;</span> <span class="nx">p_sState</span> <span class="o">!=</span> <span class="s2">&quot;hoveroption&quot;</span><span class="p">)</span> <span class="p">{</span>
        
                    <span class="k">this</span><span class="p">.</span><span class="nx">addClass</span><span class="p">(</span><span class="nx">sPrefix</span> <span class="o">+</span> <span class="k">this</span><span class="p">.</span><span class="nx">CSS_CLASS_NAME</span> <span class="o">+</span> <span class="p">(</span><span class="s2">&quot;-&quot;</span> <span class="o">+</span> <span class="nx">p_sState</span><span class="p">));</span>
        
                <span class="p">}</span>
        
                <span class="k">this</span><span class="p">.</span><span class="nx">addClass</span><span class="p">(</span><span class="nx">sPrefix</span> <span class="o">+</span> <span class="nx">sType</span> <span class="o">+</span> <span class="p">(</span><span class="s2">&quot;-button-&quot;</span> <span class="o">+</span> <span class="nx">p_sState</span><span class="p">));</span>
            
            <span class="p">}</span>
        
        <span class="p">},</span>
        
        
        <span class="cm">/**</span>
<span class="cm">        * @method removeStateCSSClasses</span>
<span class="cm">        * @description Removes state-specific CSS classes to the button&#39;s root </span>
<span class="cm">        * DOM element.</span>
<span class="cm">        */</span>
        <span class="nx">removeStateCSSClasses</span><span class="o">:</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">p_sState</span><span class="p">)</span> <span class="p">{</span>
        
            <span class="kd">var</span> <span class="nx">sType</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;type&quot;</span><span class="p">),</span>
				<span class="nx">sPrefix</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">CLASS_NAME_PREFIX</span><span class="p">;</span>
        
            <span class="k">if</span> <span class="p">(</span><span class="nx">Lang</span><span class="p">.</span><span class="nx">isString</span><span class="p">(</span><span class="nx">p_sState</span><span class="p">))</span> <span class="p">{</span>
        
                <span class="k">this</span><span class="p">.</span><span class="nx">removeClass</span><span class="p">(</span><span class="nx">sPrefix</span> <span class="o">+</span> <span class="k">this</span><span class="p">.</span><span class="nx">CSS_CLASS_NAME</span> <span class="o">+</span> <span class="p">(</span><span class="s2">&quot;-&quot;</span> <span class="o">+</span> <span class="nx">p_sState</span><span class="p">));</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">removeClass</span><span class="p">(</span><span class="nx">sPrefix</span> <span class="o">+</span> <span class="nx">sType</span> <span class="o">+</span> <span class="p">(</span><span class="s2">&quot;-button-&quot;</span> <span class="o">+</span> <span class="nx">p_sState</span><span class="p">));</span>
            
            <span class="p">}</span>
        
        <span class="p">},</span>
        
        
        <span class="cm">/**</span>
<span class="cm">        * @method createHiddenFields</span>
<span class="cm">        * @description Creates the button&#39;s hidden form field and appends it </span>
<span class="cm">        * to its parent form.</span>
<span class="cm">        * @return {&lt;a href=&quot;http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/</span>
<span class="cm">        * level-one-html.html#ID-6043025&quot;&gt;HTMLInputElement&lt;/a&gt;|Array}</span>
<span class="cm">        */</span>
        <span class="nx">createHiddenFields</span><span class="o">:</span> <span class="kd">function</span> <span class="p">()</span> <span class="p">{</span>
        
            <span class="k">this</span><span class="p">.</span><span class="nx">removeHiddenFields</span><span class="p">();</span>
        
            <span class="kd">var</span> <span class="nx">oForm</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getForm</span><span class="p">(),</span>
                <span class="nx">oButtonField</span><span class="p">,</span>
                <span class="nx">sType</span><span class="p">,</span>
                <span class="nx">bCheckable</span><span class="p">,</span>
                <span class="nx">oMenu</span><span class="p">,</span>
                <span class="nx">oMenuItem</span><span class="p">,</span>
                <span class="nx">sButtonName</span><span class="p">,</span>
                <span class="nx">oValue</span><span class="p">,</span>
                <span class="nx">oMenuField</span><span class="p">,</span>
                <span class="nx">oReturnVal</span><span class="p">,</span>
				<span class="nx">sMenuFieldName</span><span class="p">,</span>
				<span class="nx">oMenuSrcElement</span><span class="p">,</span>
				<span class="nx">bMenuSrcElementIsSelect</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span>
        
        
            <span class="k">if</span> <span class="p">(</span><span class="nx">oForm</span> <span class="o">&amp;&amp;</span> <span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;disabled&quot;</span><span class="p">))</span> <span class="p">{</span>
        
                <span class="nx">sType</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;type&quot;</span><span class="p">);</span>
                <span class="nx">bCheckable</span> <span class="o">=</span> <span class="p">(</span><span class="nx">sType</span> <span class="o">==</span> <span class="s2">&quot;checkbox&quot;</span> <span class="o">||</span> <span class="nx">sType</span> <span class="o">==</span> <span class="s2">&quot;radio&quot;</span><span class="p">);</span>
        
        
                <span class="k">if</span> <span class="p">((</span><span class="nx">bCheckable</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;checked&quot;</span><span class="p">))</span> <span class="o">||</span> <span class="p">(</span><span class="nx">m_oSubmitTrigger</span> <span class="o">==</span> <span class="k">this</span><span class="p">))</span> <span class="p">{</span>
                
                    <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Creating hidden field.&quot;</span><span class="p">,</span> <span class="s2">&quot;info&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
        
                    <span class="nx">oButtonField</span> <span class="o">=</span> <span class="nx">createInputElement</span><span class="p">((</span><span class="nx">bCheckable</span> <span class="o">?</span> <span class="nx">sType</span> <span class="o">:</span> <span class="s2">&quot;hidden&quot;</span><span class="p">),</span>
                                    <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;name&quot;</span><span class="p">),</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;value&quot;</span><span class="p">),</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;checked&quot;</span><span class="p">));</span>
            
            
                    <span class="k">if</span> <span class="p">(</span><span class="nx">oButtonField</span><span class="p">)</span> <span class="p">{</span>
            
                        <span class="k">if</span> <span class="p">(</span><span class="nx">bCheckable</span><span class="p">)</span> <span class="p">{</span>
            
                            <span class="nx">oButtonField</span><span class="p">.</span><span class="nx">style</span><span class="p">.</span><span class="nx">display</span> <span class="o">=</span> <span class="s2">&quot;none&quot;</span><span class="p">;</span>
            
                        <span class="p">}</span>
            
                        <span class="nx">oForm</span><span class="p">.</span><span class="nx">appendChild</span><span class="p">(</span><span class="nx">oButtonField</span><span class="p">);</span>
            
                    <span class="p">}</span>
        
                <span class="p">}</span>
                    
        
                <span class="nx">oMenu</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_menu</span><span class="p">;</span>
            
            
                <span class="k">if</span> <span class="p">(</span><span class="nx">Menu</span> <span class="o">&amp;&amp;</span> <span class="nx">oMenu</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">oMenu</span> <span class="k">instanceof</span> <span class="nx">Menu</span><span class="p">))</span> <span class="p">{</span>
        
                    <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Creating hidden field for menu.&quot;</span><span class="p">,</span> <span class="s2">&quot;info&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
        
                    <span class="nx">oMenuItem</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;selectedMenuItem&quot;</span><span class="p">);</span>
					<span class="nx">oMenuSrcElement</span> <span class="o">=</span> <span class="nx">oMenu</span><span class="p">.</span><span class="nx">srcElement</span><span class="p">;</span>
					<span class="nx">bMenuSrcElementIsSelect</span> <span class="o">=</span> <span class="p">(</span><span class="nx">oMenuSrcElement</span> <span class="o">&amp;&amp;</span> 
												<span class="nx">oMenuSrcElement</span><span class="p">.</span><span class="nx">nodeName</span><span class="p">.</span><span class="nx">toUpperCase</span><span class="p">()</span> <span class="o">==</span> <span class="s2">&quot;SELECT&quot;</span><span class="p">);</span>

                    <span class="k">if</span> <span class="p">(</span><span class="nx">oMenuItem</span><span class="p">)</span> <span class="p">{</span>

						<span class="nx">oValue</span> <span class="o">=</span> <span class="p">(</span><span class="nx">oMenuItem</span><span class="p">.</span><span class="nx">value</span> <span class="o">===</span> <span class="kc">null</span> <span class="o">||</span> <span class="nx">oMenuItem</span><span class="p">.</span><span class="nx">value</span> <span class="o">===</span> <span class="s2">&quot;&quot;</span><span class="p">)</span> <span class="o">?</span> 
									<span class="nx">oMenuItem</span><span class="p">.</span><span class="nx">cfg</span><span class="p">.</span><span class="nx">getProperty</span><span class="p">(</span><span class="s2">&quot;text&quot;</span><span class="p">)</span> <span class="o">:</span> <span class="nx">oMenuItem</span><span class="p">.</span><span class="nx">value</span><span class="p">;</span>

						<span class="nx">sButtonName</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;name&quot;</span><span class="p">);</span>


						<span class="k">if</span> <span class="p">(</span><span class="nx">bMenuSrcElementIsSelect</span><span class="p">)</span> <span class="p">{</span>
						
							<span class="nx">sMenuFieldName</span> <span class="o">=</span> <span class="nx">oMenuSrcElement</span><span class="p">.</span><span class="nx">name</span><span class="p">;</span>
						
						<span class="p">}</span>
						<span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="nx">sButtonName</span><span class="p">)</span> <span class="p">{</span>

							<span class="nx">sMenuFieldName</span> <span class="o">=</span> <span class="p">(</span><span class="nx">sButtonName</span> <span class="o">+</span> <span class="s2">&quot;_options&quot;</span><span class="p">);</span>
						
						<span class="p">}</span>
						

						<span class="k">if</span> <span class="p">(</span><span class="nx">oValue</span> <span class="o">&amp;&amp;</span> <span class="nx">sMenuFieldName</span><span class="p">)</span> <span class="p">{</span>
		
							<span class="nx">oMenuField</span> <span class="o">=</span> <span class="nx">createInputElement</span><span class="p">(</span><span class="s2">&quot;hidden&quot;</span><span class="p">,</span> <span class="nx">sMenuFieldName</span><span class="p">,</span> <span class="nx">oValue</span><span class="p">);</span>
							<span class="nx">oForm</span><span class="p">.</span><span class="nx">appendChild</span><span class="p">(</span><span class="nx">oMenuField</span><span class="p">);</span>
		
						<span class="p">}</span>
                    
                    <span class="p">}</span>
                    <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="nx">bMenuSrcElementIsSelect</span><span class="p">)</span> <span class="p">{</span>
					
						<span class="nx">oMenuField</span> <span class="o">=</span> <span class="nx">oForm</span><span class="p">.</span><span class="nx">appendChild</span><span class="p">(</span><span class="nx">oMenuSrcElement</span><span class="p">);</span>
                    
                    <span class="p">}</span>
        
                <span class="p">}</span>
            
            
                <span class="k">if</span> <span class="p">(</span><span class="nx">oButtonField</span> <span class="o">&amp;&amp;</span> <span class="nx">oMenuField</span><span class="p">)</span> <span class="p">{</span>
        
                    <span class="k">this</span><span class="p">.</span><span class="nx">_hiddenFields</span> <span class="o">=</span> <span class="p">[</span><span class="nx">oButtonField</span><span class="p">,</span> <span class="nx">oMenuField</span><span class="p">];</span>
        
                <span class="p">}</span>
                <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">oButtonField</span> <span class="o">&amp;&amp;</span> <span class="nx">oMenuField</span><span class="p">)</span> <span class="p">{</span>
        
                    <span class="k">this</span><span class="p">.</span><span class="nx">_hiddenFields</span> <span class="o">=</span> <span class="nx">oMenuField</span><span class="p">;</span>
                
                <span class="p">}</span>
                <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="nx">oButtonField</span> <span class="o">&amp;&amp;</span> <span class="o">!</span><span class="nx">oMenuField</span><span class="p">)</span> <span class="p">{</span>
        
                    <span class="k">this</span><span class="p">.</span><span class="nx">_hiddenFields</span> <span class="o">=</span> <span class="nx">oButtonField</span><span class="p">;</span>
                
                <span class="p">}</span>
        
        		<span class="nx">oReturnVal</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_hiddenFields</span><span class="p">;</span>
        
            <span class="p">}</span>

			<span class="k">return</span> <span class="nx">oReturnVal</span><span class="p">;</span>
        
        <span class="p">},</span>
        
        
        <span class="cm">/**</span>
<span class="cm">        * @method removeHiddenFields</span>
<span class="cm">        * @description Removes the button&#39;s hidden form field(s) from its </span>
<span class="cm">        * parent form.</span>
<span class="cm">        */</span>
        <span class="nx">removeHiddenFields</span><span class="o">:</span> <span class="kd">function</span> <span class="p">()</span> <span class="p">{</span>
        
            <span class="kd">var</span> <span class="nx">oField</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_hiddenFields</span><span class="p">,</span>
                <span class="nx">nFields</span><span class="p">,</span>
                <span class="nx">i</span><span class="p">;</span>
        
            <span class="kd">function</span> <span class="nx">removeChild</span><span class="p">(</span><span class="nx">p_oElement</span><span class="p">)</span> <span class="p">{</span>
        
                <span class="k">if</span> <span class="p">(</span><span class="nx">Dom</span><span class="p">.</span><span class="nx">inDocument</span><span class="p">(</span><span class="nx">p_oElement</span><span class="p">))</span> <span class="p">{</span>
        
                    <span class="nx">p_oElement</span><span class="p">.</span><span class="nx">parentNode</span><span class="p">.</span><span class="nx">removeChild</span><span class="p">(</span><span class="nx">p_oElement</span><span class="p">);</span>

                <span class="p">}</span>
                
            <span class="p">}</span>
            
        
            <span class="k">if</span> <span class="p">(</span><span class="nx">oField</span><span class="p">)</span> <span class="p">{</span>
        
                <span class="k">if</span> <span class="p">(</span><span class="nx">Lang</span><span class="p">.</span><span class="nx">isArray</span><span class="p">(</span><span class="nx">oField</span><span class="p">))</span> <span class="p">{</span>
        
                    <span class="nx">nFields</span> <span class="o">=</span> <span class="nx">oField</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span>
                    
                    <span class="k">if</span> <span class="p">(</span><span class="nx">nFields</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
                    
                        <span class="nx">i</span> <span class="o">=</span> <span class="nx">nFields</span> <span class="o">-</span> <span class="mi">1</span><span class="p">;</span>
                        
                        <span class="k">do</span> <span class="p">{</span>
        
                            <span class="nx">removeChild</span><span class="p">(</span><span class="nx">oField</span><span class="p">[</span><span class="nx">i</span><span class="p">]);</span>
        
                        <span class="p">}</span>
                        <span class="k">while</span> <span class="p">(</span><span class="nx">i</span><span class="o">--</span><span class="p">);</span>
                    
                    <span class="p">}</span>
                
                <span class="p">}</span>
                <span class="k">else</span> <span class="p">{</span>
        
                    <span class="nx">removeChild</span><span class="p">(</span><span class="nx">oField</span><span class="p">);</span>
        
                <span class="p">}</span>
        
                <span class="k">this</span><span class="p">.</span><span class="nx">_hiddenFields</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>
            
            <span class="p">}</span>
        
        <span class="p">},</span>
        
        
        <span class="cm">/**</span>
<span class="cm">        * @method submitForm</span>
<span class="cm">        * @description Submits the form to which the button belongs.  Returns  </span>
<span class="cm">        * true if the form was submitted successfully, false if the submission </span>
<span class="cm">        * was cancelled.</span>
<span class="cm">        * @protected</span>
<span class="cm">        * @return {Boolean}</span>
<span class="cm">        */</span>
        <span class="nx">submitForm</span><span class="o">:</span> <span class="kd">function</span> <span class="p">()</span> <span class="p">{</span>
        
            <span class="kd">var</span> <span class="nx">oForm</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getForm</span><span class="p">(),</span>
        
                <span class="nx">oSrcElement</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;srcelement&quot;</span><span class="p">),</span>
        
                <span class="cm">/*</span>
<span class="cm">                    Boolean indicating if the event fired successfully </span>
<span class="cm">                    (was not cancelled by any handlers)</span>
<span class="cm">                */</span>
        
                <span class="nx">bSubmitForm</span> <span class="o">=</span> <span class="kc">false</span><span class="p">,</span>
                
                <span class="nx">oEvent</span><span class="p">;</span>
        
        
            <span class="k">if</span> <span class="p">(</span><span class="nx">oForm</span><span class="p">)</span> <span class="p">{</span>
        
                <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;type&quot;</span><span class="p">)</span> <span class="o">==</span> <span class="s2">&quot;submit&quot;</span> <span class="o">||</span> <span class="p">(</span><span class="nx">oSrcElement</span> <span class="o">&amp;&amp;</span> <span class="nx">oSrcElement</span><span class="p">.</span><span class="nx">type</span> <span class="o">==</span> <span class="s2">&quot;submit&quot;</span><span class="p">))</span> <span class="p">{</span>
        
                    <span class="nx">m_oSubmitTrigger</span> <span class="o">=</span> <span class="k">this</span><span class="p">;</span>
                    
                <span class="p">}</span>
        
        
                <span class="k">if</span> <span class="p">(</span><span class="nx">UA</span><span class="p">.</span><span class="nx">ie</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">UA</span><span class="p">.</span><span class="nx">ie</span> <span class="o">&lt;</span> <span class="mi">9</span><span class="p">))</span> <span class="p">{</span>
        
                    <span class="nx">bSubmitForm</span> <span class="o">=</span> <span class="nx">oForm</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;onsubmit&quot;</span><span class="p">);</span>
        
                <span class="p">}</span>
                <span class="k">else</span> <span class="p">{</span>  <span class="c1">// Gecko, Opera, and Safari</span>
        
                    <span class="nx">oEvent</span> <span class="o">=</span> <span class="nb">document</span><span class="p">.</span><span class="nx">createEvent</span><span class="p">(</span><span class="s2">&quot;HTMLEvents&quot;</span><span class="p">);</span>
                    <span class="nx">oEvent</span><span class="p">.</span><span class="nx">initEvent</span><span class="p">(</span><span class="s2">&quot;submit&quot;</span><span class="p">,</span> <span class="kc">true</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span>
        
                    <span class="nx">bSubmitForm</span> <span class="o">=</span> <span class="nx">oForm</span><span class="p">.</span><span class="nx">dispatchEvent</span><span class="p">(</span><span class="nx">oEvent</span><span class="p">);</span>
        
                <span class="p">}</span>
        
        
                <span class="cm">/*</span>
<span class="cm">                    In IE and Safari, dispatching a &quot;submit&quot; event to a form </span>
<span class="cm">                    WILL cause the form&#39;s &quot;submit&quot; event to fire, but WILL NOT </span>
<span class="cm">                    submit the form.  Therefore, we need to call the &quot;submit&quot; </span>
<span class="cm">                    method as well.</span>
<span class="cm">                */</span>
              
                <span class="k">if</span> <span class="p">((</span><span class="nx">UA</span><span class="p">.</span><span class="nx">ie</span> <span class="o">||</span> <span class="nx">UA</span><span class="p">.</span><span class="nx">webkit</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="nx">bSubmitForm</span><span class="p">)</span> <span class="p">{</span>
        
                    <span class="nx">oForm</span><span class="p">.</span><span class="nx">submit</span><span class="p">();</span>
                
                <span class="p">}</span>
            
            <span class="p">}</span>
        
            <span class="k">return</span> <span class="nx">bSubmitForm</span><span class="p">;</span>
            
        <span class="p">},</span>
        
        
        <span class="cm">/**</span>
<span class="cm">        * @method init</span>
<span class="cm">        * @description The Button class&#39;s initialization method.</span>
<span class="cm">        * @param {String} p_oElement String specifying the id attribute of the </span>
<span class="cm">        * &lt;code&gt;&amp;#60;input&amp;#62;&lt;/code&gt;, &lt;code&gt;&amp;#60;button&amp;#62;&lt;/code&gt;,</span>
<span class="cm">        * &lt;code&gt;&amp;#60;a&amp;#62;&lt;/code&gt;, or &lt;code&gt;&amp;#60;span&amp;#62;&lt;/code&gt; element to </span>
<span class="cm">        * be used to create the button.</span>
<span class="cm">        * @param {&lt;a href=&quot;http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/</span>
<span class="cm">        * level-one-html.html#ID-6043025&quot;&gt;HTMLInputElement&lt;/a&gt;|&lt;a href=&quot;http://</span>
<span class="cm">        * www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-html.html</span>
<span class="cm">        * #ID-34812697&quot;&gt;HTMLButtonElement&lt;/a&gt;|&lt;a href=&quot;http://www.w3.org/TR</span>
<span class="cm">        * /2000/WD-DOM-Level-1-20000929/level-one-html.html#ID-33759296&quot;&gt;</span>
<span class="cm">        * HTMLElement&lt;/a&gt;} p_oElement Object reference for the </span>
<span class="cm">        * &lt;code&gt;&amp;#60;input&amp;#62;&lt;/code&gt;, &lt;code&gt;&amp;#60;button&amp;#62;&lt;/code&gt;, </span>
<span class="cm">        * &lt;code&gt;&amp;#60;a&amp;#62;&lt;/code&gt;, or &lt;code&gt;&amp;#60;span&amp;#62;&lt;/code&gt; element to be </span>
<span class="cm">        * used to create the button.</span>
<span class="cm">        * @param {Object} p_oElement Object literal specifying a set of </span>
<span class="cm">        * configuration attributes used to create the button.</span>
<span class="cm">        * @param {Object} p_oAttributes Optional. Object literal specifying a </span>
<span class="cm">        * set of configuration attributes used to create the button.</span>
<span class="cm">        */</span>
        <span class="nx">init</span><span class="o">:</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">p_oElement</span><span class="p">,</span> <span class="nx">p_oAttributes</span><span class="p">)</span> <span class="p">{</span>
        
            <span class="kd">var</span> <span class="nx">sNodeName</span> <span class="o">=</span> <span class="nx">p_oAttributes</span><span class="p">.</span><span class="nx">type</span> <span class="o">==</span> <span class="s2">&quot;link&quot;</span> <span class="o">?</span> <span class="s2">&quot;a&quot;</span> <span class="o">:</span> <span class="s2">&quot;button&quot;</span><span class="p">,</span>
                <span class="nx">oSrcElement</span> <span class="o">=</span> <span class="nx">p_oAttributes</span><span class="p">.</span><span class="nx">srcelement</span><span class="p">,</span>
                <span class="nx">oButton</span> <span class="o">=</span> <span class="nx">p_oElement</span><span class="p">.</span><span class="nx">getElementsByTagName</span><span class="p">(</span><span class="nx">sNodeName</span><span class="p">)[</span><span class="mi">0</span><span class="p">],</span>
                <span class="nx">oInput</span><span class="p">;</span>


            <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">oButton</span><span class="p">)</span> <span class="p">{</span>

                <span class="nx">oInput</span> <span class="o">=</span> <span class="nx">p_oElement</span><span class="p">.</span><span class="nx">getElementsByTagName</span><span class="p">(</span><span class="s2">&quot;input&quot;</span><span class="p">)[</span><span class="mi">0</span><span class="p">];</span>


                <span class="k">if</span> <span class="p">(</span><span class="nx">oInput</span><span class="p">)</span> <span class="p">{</span>

                    <span class="nx">oButton</span> <span class="o">=</span> <span class="nb">document</span><span class="p">.</span><span class="nx">createElement</span><span class="p">(</span><span class="s2">&quot;button&quot;</span><span class="p">);</span>
                    <span class="nx">oButton</span><span class="p">.</span><span class="nx">setAttribute</span><span class="p">(</span><span class="s2">&quot;type&quot;</span><span class="p">,</span> <span class="s2">&quot;button&quot;</span><span class="p">);</span>

                    <span class="nx">oInput</span><span class="p">.</span><span class="nx">parentNode</span><span class="p">.</span><span class="nx">replaceChild</span><span class="p">(</span><span class="nx">oButton</span><span class="p">,</span> <span class="nx">oInput</span><span class="p">);</span>
                
                <span class="p">}</span>

            <span class="p">}</span>

            <span class="k">this</span><span class="p">.</span><span class="nx">_button</span> <span class="o">=</span> <span class="nx">oButton</span><span class="p">;</span>


            <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">widget</span><span class="p">.</span><span class="nx">Button</span><span class="p">.</span><span class="nx">superclass</span><span class="p">.</span><span class="nx">init</span><span class="p">.</span><span class="nx">call</span><span class="p">(</span><span class="k">this</span><span class="p">,</span> <span class="nx">p_oElement</span><span class="p">,</span> <span class="nx">p_oAttributes</span><span class="p">);</span>


			<span class="kd">var</span> <span class="nx">sId</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;id&quot;</span><span class="p">),</span>
				<span class="nx">sButtonId</span> <span class="o">=</span> <span class="nx">sId</span> <span class="o">+</span> <span class="s2">&quot;-button&quot;</span><span class="p">;</span>


        	<span class="nx">oButton</span><span class="p">.</span><span class="nx">id</span> <span class="o">=</span> <span class="nx">sButtonId</span><span class="p">;</span>


			<span class="kd">var</span> <span class="nx">aLabels</span><span class="p">,</span>
				<span class="nx">oLabel</span><span class="p">;</span>


        	<span class="kd">var</span> <span class="nx">hasLabel</span> <span class="o">=</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">element</span><span class="p">)</span> <span class="p">{</span>
        	
				<span class="k">return</span> <span class="p">(</span><span class="nx">element</span><span class="p">.</span><span class="nx">htmlFor</span> <span class="o">===</span> <span class="nx">sId</span><span class="p">);</span>

        	<span class="p">};</span>


			<span class="kd">var</span> <span class="nx">setLabel</span> <span class="o">=</span> <span class="kd">function</span> <span class="p">()</span> <span class="p">{</span>

				<span class="nx">oLabel</span><span class="p">.</span><span class="nx">setAttribute</span><span class="p">((</span><span class="nx">UA</span><span class="p">.</span><span class="nx">ie</span> <span class="o">?</span> <span class="s2">&quot;htmlFor&quot;</span> <span class="o">:</span> <span class="s2">&quot;for&quot;</span><span class="p">),</span> <span class="nx">sButtonId</span><span class="p">);</span>
			
			<span class="p">};</span>


			<span class="k">if</span> <span class="p">(</span><span class="nx">oSrcElement</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;type&quot;</span><span class="p">)</span> <span class="o">!=</span> <span class="s2">&quot;link&quot;</span><span class="p">)</span> <span class="p">{</span>

				<span class="nx">aLabels</span> <span class="o">=</span> <span class="nx">Dom</span><span class="p">.</span><span class="nx">getElementsBy</span><span class="p">(</span><span class="nx">hasLabel</span><span class="p">,</span> <span class="s2">&quot;label&quot;</span><span class="p">);</span>

				<span class="k">if</span> <span class="p">(</span><span class="nx">Lang</span><span class="p">.</span><span class="nx">isArray</span><span class="p">(</span><span class="nx">aLabels</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="nx">aLabels</span><span class="p">.</span><span class="nx">length</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
				
					<span class="nx">oLabel</span> <span class="o">=</span> <span class="nx">aLabels</span><span class="p">[</span><span class="mi">0</span><span class="p">];</span>
				
				<span class="p">}</span>

			<span class="p">}</span>
        

            <span class="nx">m_oButtons</span><span class="p">[</span><span class="nx">sId</span><span class="p">]</span> <span class="o">=</span> <span class="k">this</span><span class="p">;</span>

        	<span class="kd">var</span> <span class="nx">sPrefix</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">CLASS_NAME_PREFIX</span><span class="p">;</span>

            <span class="k">this</span><span class="p">.</span><span class="nx">addClass</span><span class="p">(</span><span class="nx">sPrefix</span> <span class="o">+</span> <span class="k">this</span><span class="p">.</span><span class="nx">CSS_CLASS_NAME</span><span class="p">);</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">addClass</span><span class="p">(</span><span class="nx">sPrefix</span> <span class="o">+</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;type&quot;</span><span class="p">)</span> <span class="o">+</span> <span class="s2">&quot;-button&quot;</span><span class="p">);</span>
        
            <span class="nx">Event</span><span class="p">.</span><span class="nx">on</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_button</span><span class="p">,</span> <span class="s2">&quot;focus&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_onFocus</span><span class="p">,</span> <span class="kc">null</span><span class="p">,</span> <span class="k">this</span><span class="p">);</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">on</span><span class="p">(</span><span class="s2">&quot;mouseover&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_onMouseOver</span><span class="p">);</span>
			<span class="k">this</span><span class="p">.</span><span class="nx">on</span><span class="p">(</span><span class="s2">&quot;mousedown&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_onMouseDown</span><span class="p">);</span>
			<span class="k">this</span><span class="p">.</span><span class="nx">on</span><span class="p">(</span><span class="s2">&quot;mouseup&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_onMouseUp</span><span class="p">);</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">on</span><span class="p">(</span><span class="s2">&quot;click&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_onClick</span><span class="p">);</span>

			<span class="c1">//	Need to reset the value of the &quot;onclick&quot; Attribute so that any</span>
			<span class="c1">//	handlers registered via the &quot;onclick&quot; Attribute are fired after </span>
			<span class="c1">//	Button&#39;s default &quot;_onClick&quot; listener.</span>

			<span class="kd">var</span> <span class="nx">fnOnClick</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;onclick&quot;</span><span class="p">);</span>

			<span class="k">this</span><span class="p">.</span><span class="nx">set</span><span class="p">(</span><span class="s2">&quot;onclick&quot;</span><span class="p">,</span> <span class="kc">null</span><span class="p">);</span>
			<span class="k">this</span><span class="p">.</span><span class="nx">set</span><span class="p">(</span><span class="s2">&quot;onclick&quot;</span><span class="p">,</span> <span class="nx">fnOnClick</span><span class="p">);</span>

            <span class="k">this</span><span class="p">.</span><span class="nx">on</span><span class="p">(</span><span class="s2">&quot;dblclick&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_onDblClick</span><span class="p">);</span>


			<span class="kd">var</span> <span class="nx">oParentNode</span><span class="p">;</span>

            <span class="k">if</span> <span class="p">(</span><span class="nx">oLabel</span><span class="p">)</span> <span class="p">{</span>
            
				<span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;replaceLabel&quot;</span><span class="p">))</span> <span class="p">{</span>

					<span class="k">this</span><span class="p">.</span><span class="nx">set</span><span class="p">(</span><span class="s2">&quot;label&quot;</span><span class="p">,</span> <span class="nx">oLabel</span><span class="p">.</span><span class="nx">innerHTML</span><span class="p">);</span>
					
					<span class="nx">oParentNode</span> <span class="o">=</span> <span class="nx">oLabel</span><span class="p">.</span><span class="nx">parentNode</span><span class="p">;</span>
					
					<span class="nx">oParentNode</span><span class="p">.</span><span class="nx">removeChild</span><span class="p">(</span><span class="nx">oLabel</span><span class="p">);</span>
					
				<span class="p">}</span>
				<span class="k">else</span> <span class="p">{</span>

					<span class="k">this</span><span class="p">.</span><span class="nx">on</span><span class="p">(</span><span class="s2">&quot;appendTo&quot;</span><span class="p">,</span> <span class="nx">setLabel</span><span class="p">);</span> 

					<span class="nx">Event</span><span class="p">.</span><span class="nx">on</span><span class="p">(</span><span class="nx">oLabel</span><span class="p">,</span> <span class="s2">&quot;click&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_onLabelClick</span><span class="p">,</span> <span class="kc">null</span><span class="p">,</span> <span class="k">this</span><span class="p">);</span>

					<span class="k">this</span><span class="p">.</span><span class="nx">_label</span> <span class="o">=</span> <span class="nx">oLabel</span><span class="p">;</span>
					
				<span class="p">}</span>
            
            <span class="p">}</span>
            
            <span class="k">this</span><span class="p">.</span><span class="nx">on</span><span class="p">(</span><span class="s2">&quot;appendTo&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_onAppendTo</span><span class="p">);</span>
       
        

            <span class="kd">var</span> <span class="nx">oContainer</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;container&quot;</span><span class="p">),</span>
                <span class="nx">oElement</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;element&quot;</span><span class="p">),</span>
                <span class="nx">bElInDoc</span> <span class="o">=</span> <span class="nx">Dom</span><span class="p">.</span><span class="nx">inDocument</span><span class="p">(</span><span class="nx">oElement</span><span class="p">);</span>


            <span class="k">if</span> <span class="p">(</span><span class="nx">oContainer</span><span class="p">)</span> <span class="p">{</span>
        
                <span class="k">if</span> <span class="p">(</span><span class="nx">oSrcElement</span> <span class="o">&amp;&amp;</span> <span class="nx">oSrcElement</span> <span class="o">!=</span> <span class="nx">oElement</span><span class="p">)</span> <span class="p">{</span>
                
                    <span class="nx">oParentNode</span> <span class="o">=</span> <span class="nx">oSrcElement</span><span class="p">.</span><span class="nx">parentNode</span><span class="p">;</span>

                    <span class="k">if</span> <span class="p">(</span><span class="nx">oParentNode</span><span class="p">)</span> <span class="p">{</span>
                    
                        <span class="nx">oParentNode</span><span class="p">.</span><span class="nx">removeChild</span><span class="p">(</span><span class="nx">oSrcElement</span><span class="p">);</span>
                    
                    <span class="p">}</span>

                <span class="p">}</span>
        
                <span class="k">if</span> <span class="p">(</span><span class="nx">Lang</span><span class="p">.</span><span class="nx">isString</span><span class="p">(</span><span class="nx">oContainer</span><span class="p">))</span> <span class="p">{</span>
        
                    <span class="nx">Event</span><span class="p">.</span><span class="nx">onContentReady</span><span class="p">(</span><span class="nx">oContainer</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">appendTo</span><span class="p">,</span> <span class="nx">oContainer</span><span class="p">,</span> <span class="k">this</span><span class="p">);</span>
        
                <span class="p">}</span>
                <span class="k">else</span> <span class="p">{</span>
        
        			<span class="k">this</span><span class="p">.</span><span class="nx">on</span><span class="p">(</span><span class="s2">&quot;init&quot;</span><span class="p">,</span> <span class="kd">function</span> <span class="p">()</span> <span class="p">{</span>
        			
        				<span class="nx">Lang</span><span class="p">.</span><span class="nx">later</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="k">this</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">appendTo</span><span class="p">,</span> <span class="nx">oContainer</span><span class="p">);</span>
        			
        			<span class="p">});</span>
        
                <span class="p">}</span>
        
            <span class="p">}</span>
            <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">bElInDoc</span> <span class="o">&amp;&amp;</span> <span class="nx">oSrcElement</span> <span class="o">&amp;&amp;</span> <span class="nx">oSrcElement</span> <span class="o">!=</span> <span class="nx">oElement</span><span class="p">)</span> <span class="p">{</span>

                <span class="nx">oParentNode</span> <span class="o">=</span> <span class="nx">oSrcElement</span><span class="p">.</span><span class="nx">parentNode</span><span class="p">;</span>
        
                <span class="k">if</span> <span class="p">(</span><span class="nx">oParentNode</span><span class="p">)</span> <span class="p">{</span>
        
                    <span class="k">this</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;beforeAppendTo&quot;</span><span class="p">,</span> <span class="p">{</span>
                        <span class="nx">type</span><span class="o">:</span> <span class="s2">&quot;beforeAppendTo&quot;</span><span class="p">,</span>
                        <span class="nx">target</span><span class="o">:</span> <span class="nx">oParentNode</span>
                    <span class="p">});</span>
            
                    <span class="nx">oParentNode</span><span class="p">.</span><span class="nx">replaceChild</span><span class="p">(</span><span class="nx">oElement</span><span class="p">,</span> <span class="nx">oSrcElement</span><span class="p">);</span>
            
                    <span class="k">this</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;appendTo&quot;</span><span class="p">,</span> <span class="p">{</span>
                        <span class="nx">type</span><span class="o">:</span> <span class="s2">&quot;appendTo&quot;</span><span class="p">,</span>
                        <span class="nx">target</span><span class="o">:</span> <span class="nx">oParentNode</span>
                    <span class="p">});</span>
                
                <span class="p">}</span>
        
            <span class="p">}</span>
            <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;type&quot;</span><span class="p">)</span> <span class="o">!=</span> <span class="s2">&quot;link&quot;</span> <span class="o">&amp;&amp;</span> <span class="nx">bElInDoc</span> <span class="o">&amp;&amp;</span> <span class="nx">oSrcElement</span> <span class="o">&amp;&amp;</span> 
                <span class="nx">oSrcElement</span> <span class="o">==</span> <span class="nx">oElement</span><span class="p">)</span> <span class="p">{</span>
        
                <span class="k">this</span><span class="p">.</span><span class="nx">_addListenersToForm</span><span class="p">();</span>
        
            <span class="p">}</span>
        
            <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Initialization completed.&quot;</span><span class="p">,</span> <span class="s2">&quot;info&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
        

			<span class="k">this</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;init&quot;</span><span class="p">,</span> <span class="p">{</span>
				<span class="nx">type</span><span class="o">:</span> <span class="s2">&quot;init&quot;</span><span class="p">,</span>
				<span class="nx">target</span><span class="o">:</span> <span class="k">this</span>
			<span class="p">});</span>        
        
        <span class="p">},</span>
        
        
        <span class="cm">/**</span>
<span class="cm">        * @method initAttributes</span>
<span class="cm">        * @description Initializes all of the configuration attributes used to  </span>
<span class="cm">        * create the button.</span>
<span class="cm">        * @param {Object} p_oAttributes Object literal specifying a set of </span>
<span class="cm">        * configuration attributes used to create the button.</span>
<span class="cm">        */</span>
        <span class="nx">initAttributes</span><span class="o">:</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">p_oAttributes</span><span class="p">)</span> <span class="p">{</span>
        
            <span class="kd">var</span> <span class="nx">oAttributes</span> <span class="o">=</span> <span class="nx">p_oAttributes</span> <span class="o">||</span> <span class="p">{};</span>
        
            <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">widget</span><span class="p">.</span><span class="nx">Button</span><span class="p">.</span><span class="nx">superclass</span><span class="p">.</span><span class="nx">initAttributes</span><span class="p">.</span><span class="nx">call</span><span class="p">(</span><span class="k">this</span><span class="p">,</span> 
                <span class="nx">oAttributes</span><span class="p">);</span>
        
        
            <span class="cm">/**</span>
<span class="cm">            * @attribute type</span>
<span class="cm">            * @description String specifying the button&#39;s type.  Possible </span>
<span class="cm">            * values are: &quot;push,&quot; &quot;link,&quot; &quot;submit,&quot; &quot;reset,&quot; &quot;checkbox,&quot; </span>
<span class="cm">            * &quot;radio,&quot; &quot;menu,&quot; and &quot;split.&quot;</span>
<span class="cm">            * @default &quot;push&quot;</span>
<span class="cm">            * @type String</span>
<span class="cm">			* @writeonce</span>
<span class="cm">            */</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">setAttributeConfig</span><span class="p">(</span><span class="s2">&quot;type&quot;</span><span class="p">,</span> <span class="p">{</span>
        
                <span class="nx">value</span><span class="o">:</span> <span class="p">(</span><span class="nx">oAttributes</span><span class="p">.</span><span class="nx">type</span> <span class="o">||</span> <span class="s2">&quot;push&quot;</span><span class="p">),</span>
                <span class="nx">validator</span><span class="o">:</span> <span class="nx">Lang</span><span class="p">.</span><span class="nx">isString</span><span class="p">,</span>
                <span class="nx">writeOnce</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span>
                <span class="nx">method</span><span class="o">:</span> <span class="k">this</span><span class="p">.</span><span class="nx">_setType</span>

            <span class="p">});</span>
        
        
            <span class="cm">/**</span>
<span class="cm">            * @attribute label</span>
<span class="cm">            * @description {HTML} specifying the button&#39;s text label </span>
<span class="cm">            * or innerHTML.</span>
<span class="cm">            * @default null</span>
<span class="cm">            * @type String</span>
<span class="cm">            */</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">setAttributeConfig</span><span class="p">(</span><span class="s2">&quot;label&quot;</span><span class="p">,</span> <span class="p">{</span>
        
                <span class="nx">value</span><span class="o">:</span> <span class="nx">oAttributes</span><span class="p">.</span><span class="nx">label</span><span class="p">,</span>
                <span class="nx">validator</span><span class="o">:</span> <span class="nx">Lang</span><span class="p">.</span><span class="nx">isString</span><span class="p">,</span>
                <span class="nx">method</span><span class="o">:</span> <span class="k">this</span><span class="p">.</span><span class="nx">_setLabel</span>
        
            <span class="p">});</span>
        
        
            <span class="cm">/**</span>
<span class="cm">            * @attribute value</span>
<span class="cm">            * @description Object specifying the value for the button.</span>
<span class="cm">            * @default null</span>
<span class="cm">            * @type Object</span>
<span class="cm">            */</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">setAttributeConfig</span><span class="p">(</span><span class="s2">&quot;value&quot;</span><span class="p">,</span> <span class="p">{</span>
        
                <span class="nx">value</span><span class="o">:</span> <span class="nx">oAttributes</span><span class="p">.</span><span class="nx">value</span>
        
            <span class="p">});</span>
        
        
            <span class="cm">/**</span>
<span class="cm">            * @attribute name</span>
<span class="cm">            * @description String specifying the name for the button.</span>
<span class="cm">            * @default null</span>
<span class="cm">            * @type String</span>
<span class="cm">            */</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">setAttributeConfig</span><span class="p">(</span><span class="s2">&quot;name&quot;</span><span class="p">,</span> <span class="p">{</span>
        
                <span class="nx">value</span><span class="o">:</span> <span class="nx">oAttributes</span><span class="p">.</span><span class="nx">name</span><span class="p">,</span>
                <span class="nx">validator</span><span class="o">:</span> <span class="nx">Lang</span><span class="p">.</span><span class="nx">isString</span>
        
            <span class="p">});</span>
        
        
            <span class="cm">/**</span>
<span class="cm">            * @attribute tabindex</span>
<span class="cm">            * @description Number specifying the tabindex for the button.</span>
<span class="cm">            * @default null</span>
<span class="cm">            * @type Number</span>
<span class="cm">            */</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">setAttributeConfig</span><span class="p">(</span><span class="s2">&quot;tabindex&quot;</span><span class="p">,</span> <span class="p">{</span>
        
                <span class="nx">value</span><span class="o">:</span> <span class="nx">oAttributes</span><span class="p">.</span><span class="nx">tabindex</span><span class="p">,</span>
                <span class="nx">validator</span><span class="o">:</span> <span class="nx">Lang</span><span class="p">.</span><span class="nx">isNumber</span><span class="p">,</span>
                <span class="nx">method</span><span class="o">:</span> <span class="k">this</span><span class="p">.</span><span class="nx">_setTabIndex</span>
        
            <span class="p">});</span>
        
        
            <span class="cm">/**</span>
<span class="cm">            * @attribute title</span>
<span class="cm">            * @description String specifying the title for the button.</span>
<span class="cm">            * @default null</span>
<span class="cm">            * @type String</span>
<span class="cm">            */</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">configureAttribute</span><span class="p">(</span><span class="s2">&quot;title&quot;</span><span class="p">,</span> <span class="p">{</span>
        
                <span class="nx">value</span><span class="o">:</span> <span class="nx">oAttributes</span><span class="p">.</span><span class="nx">title</span><span class="p">,</span>
                <span class="nx">validator</span><span class="o">:</span> <span class="nx">Lang</span><span class="p">.</span><span class="nx">isString</span><span class="p">,</span>
                <span class="nx">method</span><span class="o">:</span> <span class="k">this</span><span class="p">.</span><span class="nx">_setTitle</span>
        
            <span class="p">});</span>
        
        
            <span class="cm">/**</span>
<span class="cm">            * @attribute disabled</span>
<span class="cm">            * @description Boolean indicating if the button should be disabled.  </span>
<span class="cm">            * (Disabled buttons are dimmed and will not respond to user input </span>
<span class="cm">            * or fire events.  Does not apply to button&#39;s of type &quot;link.&quot;)</span>
<span class="cm">            * @default false</span>
<span class="cm">            * @type Boolean</span>
<span class="cm">            */</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">setAttributeConfig</span><span class="p">(</span><span class="s2">&quot;disabled&quot;</span><span class="p">,</span> <span class="p">{</span>
        
                <span class="nx">value</span><span class="o">:</span> <span class="p">(</span><span class="nx">oAttributes</span><span class="p">.</span><span class="nx">disabled</span> <span class="o">||</span> <span class="kc">false</span><span class="p">),</span>
                <span class="nx">validator</span><span class="o">:</span> <span class="nx">Lang</span><span class="p">.</span><span class="nx">isBoolean</span><span class="p">,</span>
                <span class="nx">method</span><span class="o">:</span> <span class="k">this</span><span class="p">.</span><span class="nx">_setDisabled</span>
        
            <span class="p">});</span>
        
        
            <span class="cm">/**</span>
<span class="cm">            * @attribute href</span>
<span class="cm">            * @description String specifying the href for the button.  Applies</span>
<span class="cm">            * only to buttons of type &quot;link.&quot;</span>
<span class="cm">            * @type String</span>
<span class="cm">            */</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">setAttributeConfig</span><span class="p">(</span><span class="s2">&quot;href&quot;</span><span class="p">,</span> <span class="p">{</span>
        
                <span class="nx">value</span><span class="o">:</span> <span class="nx">oAttributes</span><span class="p">.</span><span class="nx">href</span><span class="p">,</span>
                <span class="nx">validator</span><span class="o">:</span> <span class="nx">Lang</span><span class="p">.</span><span class="nx">isString</span><span class="p">,</span>
                <span class="nx">method</span><span class="o">:</span> <span class="k">this</span><span class="p">.</span><span class="nx">_setHref</span>
        
            <span class="p">});</span>
        
        
            <span class="cm">/**</span>
<span class="cm">            * @attribute target</span>
<span class="cm">            * @description String specifying the target for the button.  </span>
<span class="cm">            * Applies only to buttons of type &quot;link.&quot;</span>
<span class="cm">            * @type String</span>
<span class="cm">            */</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">setAttributeConfig</span><span class="p">(</span><span class="s2">&quot;target&quot;</span><span class="p">,</span> <span class="p">{</span>
        
                <span class="nx">value</span><span class="o">:</span> <span class="nx">oAttributes</span><span class="p">.</span><span class="nx">target</span><span class="p">,</span>
                <span class="nx">validator</span><span class="o">:</span> <span class="nx">Lang</span><span class="p">.</span><span class="nx">isString</span><span class="p">,</span>
                <span class="nx">method</span><span class="o">:</span> <span class="k">this</span><span class="p">.</span><span class="nx">_setTarget</span>
        
            <span class="p">});</span>
        
        
            <span class="cm">/**</span>
<span class="cm">            * @attribute checked</span>
<span class="cm">            * @description Boolean indicating if the button is checked. </span>
<span class="cm">            * Applies only to buttons of type &quot;radio&quot; and &quot;checkbox.&quot;</span>
<span class="cm">            * @default false</span>
<span class="cm">            * @type Boolean</span>
<span class="cm">            */</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">setAttributeConfig</span><span class="p">(</span><span class="s2">&quot;checked&quot;</span><span class="p">,</span> <span class="p">{</span>
        
                <span class="nx">value</span><span class="o">:</span> <span class="p">(</span><span class="nx">oAttributes</span><span class="p">.</span><span class="nx">checked</span> <span class="o">||</span> <span class="kc">false</span><span class="p">),</span>
                <span class="nx">validator</span><span class="o">:</span> <span class="nx">Lang</span><span class="p">.</span><span class="nx">isBoolean</span><span class="p">,</span>
                <span class="nx">method</span><span class="o">:</span> <span class="k">this</span><span class="p">.</span><span class="nx">_setChecked</span>
        
            <span class="p">});</span>
        
        
            <span class="cm">/**</span>
<span class="cm">            * @attribute container</span>
<span class="cm">            * @description HTML element reference or string specifying the id </span>
<span class="cm">            * attribute of the HTML element that the button&#39;s markup should be </span>
<span class="cm">            * rendered into.</span>
<span class="cm">            * @type &lt;a href=&quot;http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/</span>
<span class="cm">            * level-one-html.html#ID-58190037&quot;&gt;HTMLElement&lt;/a&gt;|String</span>
<span class="cm">            * @default null</span>
<span class="cm">			* @writeonce</span>
<span class="cm">            */</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">setAttributeConfig</span><span class="p">(</span><span class="s2">&quot;container&quot;</span><span class="p">,</span> <span class="p">{</span>
        
                <span class="nx">value</span><span class="o">:</span> <span class="nx">oAttributes</span><span class="p">.</span><span class="nx">container</span><span class="p">,</span>
                <span class="nx">writeOnce</span><span class="o">:</span> <span class="kc">true</span>
        
            <span class="p">});</span>
        
        
            <span class="cm">/**</span>
<span class="cm">            * @attribute srcelement</span>
<span class="cm">            * @description Object reference to the HTML element (either </span>
<span class="cm">            * &lt;code&gt;&amp;#60;input&amp;#62;&lt;/code&gt; or &lt;code&gt;&amp;#60;span&amp;#62;&lt;/code&gt;) </span>
<span class="cm">            * used to create the button.</span>
<span class="cm">            * @type &lt;a href=&quot;http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/</span>
<span class="cm">            * level-one-html.html#ID-58190037&quot;&gt;HTMLElement&lt;/a&gt;|String</span>
<span class="cm">            * @default null</span>
<span class="cm">			* @writeonce</span>
<span class="cm">            */</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">setAttributeConfig</span><span class="p">(</span><span class="s2">&quot;srcelement&quot;</span><span class="p">,</span> <span class="p">{</span>
        
                <span class="nx">value</span><span class="o">:</span> <span class="nx">oAttributes</span><span class="p">.</span><span class="nx">srcelement</span><span class="p">,</span>
                <span class="nx">writeOnce</span><span class="o">:</span> <span class="kc">true</span>
        
            <span class="p">});</span>
        
        
            <span class="cm">/**</span>
<span class="cm">            * @attribute menu</span>
<span class="cm">            * @description Object specifying the menu for the button.  </span>
<span class="cm">            * The value can be one of the following:</span>
<span class="cm">            * &lt;ul&gt;</span>
<span class="cm">            * &lt;li&gt;Object specifying a rendered &lt;a href=&quot;YAHOO.widget.Menu.html&quot;&gt;</span>
<span class="cm">            * YAHOO.widget.Menu&lt;/a&gt; instance.&lt;/li&gt;</span>
<span class="cm">            * &lt;li&gt;Object specifying a rendered &lt;a href=&quot;YAHOO.widget.Overlay.html&quot;&gt;</span>
<span class="cm">            * YAHOO.widget.Overlay&lt;/a&gt; instance.&lt;/li&gt;</span>
<span class="cm">            * &lt;li&gt;String specifying the id attribute of the &lt;code&gt;&amp;#60;div&amp;#62;</span>
<span class="cm">            * &lt;/code&gt; element used to create the menu.  By default the menu </span>
<span class="cm">            * will be created as an instance of </span>
<span class="cm">            * &lt;a href=&quot;YAHOO.widget.Overlay.html&quot;&gt;YAHOO.widget.Overlay&lt;/a&gt;.  </span>
<span class="cm">            * If the &lt;a href=&quot;YAHOO.widget.Menu.html#CSS_CLASS_NAME&quot;&gt;</span>
<span class="cm">            * default CSS class name for YAHOO.widget.Menu&lt;/a&gt; is applied to </span>
<span class="cm">            * the &lt;code&gt;&amp;#60;div&amp;#62;&lt;/code&gt; element, it will be created as an</span>
<span class="cm">            * instance of &lt;a href=&quot;YAHOO.widget.Menu.html&quot;&gt;YAHOO.widget.Menu</span>
<span class="cm">            * &lt;/a&gt;.&lt;/li&gt;&lt;li&gt;String specifying the id attribute of the </span>
<span class="cm">            * &lt;code&gt;&amp;#60;select&amp;#62;&lt;/code&gt; element used to create the menu.</span>
<span class="cm">            * &lt;/li&gt;&lt;li&gt;Object specifying the &lt;code&gt;&amp;#60;div&amp;#62;&lt;/code&gt; element</span>
<span class="cm">            * used to create the menu.&lt;/li&gt;</span>
<span class="cm">            * &lt;li&gt;Object specifying the &lt;code&gt;&amp;#60;select&amp;#62;&lt;/code&gt; element</span>
<span class="cm">            * used to create the menu.&lt;/li&gt;</span>
<span class="cm">            * &lt;li&gt;Array of object literals, each representing a set of </span>
<span class="cm">            * &lt;a href=&quot;YAHOO.widget.MenuItem.html&quot;&gt;YAHOO.widget.MenuItem&lt;/a&gt; </span>
<span class="cm">            * configuration attributes.&lt;/li&gt;</span>
<span class="cm">            * &lt;li&gt;Array of strings representing the text labels for each menu </span>
<span class="cm">            * item in the menu.&lt;/li&gt;</span>
<span class="cm">            * &lt;/ul&gt;</span>
<span class="cm">            * @type &lt;a href=&quot;YAHOO.widget.Menu.html&quot;&gt;YAHOO.widget.Menu&lt;/a&gt;|&lt;a </span>
<span class="cm">            * href=&quot;YAHOO.widget.Overlay.html&quot;&gt;YAHOO.widget.Overlay&lt;/a&gt;|&lt;a </span>
<span class="cm">            * href=&quot;http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-</span>
<span class="cm">            * one-html.html#ID-58190037&quot;&gt;HTMLElement&lt;/a&gt;|String|Array</span>
<span class="cm">            * @default null</span>
<span class="cm">			* @writeonce</span>
<span class="cm">            */</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">setAttributeConfig</span><span class="p">(</span><span class="s2">&quot;menu&quot;</span><span class="p">,</span> <span class="p">{</span>
        
                <span class="nx">value</span><span class="o">:</span> <span class="kc">null</span><span class="p">,</span>
                <span class="nx">method</span><span class="o">:</span> <span class="k">this</span><span class="p">.</span><span class="nx">_setMenu</span><span class="p">,</span>
                <span class="nx">writeOnce</span><span class="o">:</span> <span class="kc">true</span>
            
            <span class="p">});</span>
        
        
            <span class="cm">/**</span>
<span class="cm">            * @attribute lazyloadmenu</span>
<span class="cm">            * @description Boolean indicating the value to set for the </span>
<span class="cm">            * &lt;a href=&quot;YAHOO.widget.Menu.html#lazyLoad&quot;&gt;&quot;lazyload&quot;&lt;/a&gt;</span>
<span class="cm">            * configuration property of the button&#39;s menu.  Setting </span>
<span class="cm">            * &quot;lazyloadmenu&quot; to &lt;code&gt;true &lt;/code&gt; will defer rendering of </span>
<span class="cm">            * the button&#39;s menu until the first time it is made visible.  </span>
<span class="cm">            * If &quot;lazyloadmenu&quot; is set to &lt;code&gt;false&lt;/code&gt;, the button&#39;s </span>
<span class="cm">            * menu will be rendered immediately if the button is in the </span>
<span class="cm">            * document, or in response to the button&#39;s &quot;appendTo&quot; event if </span>
<span class="cm">            * the button is not yet in the document.  In either case, the </span>
<span class="cm">            * menu is rendered into the button&#39;s parent HTML element.  </span>
<span class="cm">            * &lt;em&gt;This attribute does not apply if a </span>
<span class="cm">            * &lt;a href=&quot;YAHOO.widget.Menu.html&quot;&gt;YAHOO.widget.Menu&lt;/a&gt; or </span>
<span class="cm">            * &lt;a href=&quot;YAHOO.widget.Overlay.html&quot;&gt;YAHOO.widget.Overlay&lt;/a&gt; </span>
<span class="cm">            * instance is passed as the value of the button&#39;s &quot;menu&quot; </span>
<span class="cm">            * configuration attribute. &lt;a href=&quot;YAHOO.widget.Menu.html&quot;&gt;</span>
<span class="cm">            * YAHOO.widget.Menu&lt;/a&gt; or &lt;a href=&quot;YAHOO.widget.Overlay.html&quot;&gt;</span>
<span class="cm">            * YAHOO.widget.Overlay&lt;/a&gt; instances should be rendered before </span>
<span class="cm">            * being set as the value for the &quot;menu&quot; configuration </span>
<span class="cm">            * attribute.&lt;/em&gt;</span>
<span class="cm">            * @default true</span>
<span class="cm">            * @type Boolean</span>
<span class="cm">			* @writeonce</span>
<span class="cm">            */</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">setAttributeConfig</span><span class="p">(</span><span class="s2">&quot;lazyloadmenu&quot;</span><span class="p">,</span> <span class="p">{</span>
        
                <span class="nx">value</span><span class="o">:</span> <span class="p">(</span><span class="nx">oAttributes</span><span class="p">.</span><span class="nx">lazyloadmenu</span> <span class="o">===</span> <span class="kc">false</span> <span class="o">?</span> <span class="kc">false</span> <span class="o">:</span> <span class="kc">true</span><span class="p">),</span>
                <span class="nx">validator</span><span class="o">:</span> <span class="nx">Lang</span><span class="p">.</span><span class="nx">isBoolean</span><span class="p">,</span>
                <span class="nx">writeOnce</span><span class="o">:</span> <span class="kc">true</span>
        
            <span class="p">});</span>


            <span class="cm">/**</span>
<span class="cm">            * @attribute menuclassname</span>
<span class="cm">            * @description String representing the CSS class name to be </span>
<span class="cm">            * applied to the root element of the button&#39;s menu.</span>
<span class="cm">            * @type String</span>
<span class="cm">            * @default &quot;yui-button-menu&quot;</span>
<span class="cm">			* @writeonce</span>
<span class="cm">            */</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">setAttributeConfig</span><span class="p">(</span><span class="s2">&quot;menuclassname&quot;</span><span class="p">,</span> <span class="p">{</span>
        
                <span class="nx">value</span><span class="o">:</span> <span class="p">(</span><span class="nx">oAttributes</span><span class="p">.</span><span class="nx">menuclassname</span> <span class="o">||</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">CLASS_NAME_PREFIX</span> <span class="o">+</span> <span class="s2">&quot;button-menu&quot;</span><span class="p">)),</span>
                <span class="nx">validator</span><span class="o">:</span> <span class="nx">Lang</span><span class="p">.</span><span class="nx">isString</span><span class="p">,</span>
                <span class="nx">method</span><span class="o">:</span> <span class="k">this</span><span class="p">.</span><span class="nx">_setMenuClassName</span><span class="p">,</span>
                <span class="nx">writeOnce</span><span class="o">:</span> <span class="kc">true</span>
        
            <span class="p">});</span>        


			<span class="cm">/**</span>
<span class="cm">			* @attribute menuminscrollheight</span>
<span class="cm">			* @description Number defining the minimum threshold for the &quot;menumaxheight&quot; </span>
<span class="cm">			* configuration attribute.  When set this attribute is automatically applied </span>
<span class="cm">			* to all submenus.</span>
<span class="cm">			* @default 90</span>
<span class="cm">			* @type Number</span>
<span class="cm">			*/</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">setAttributeConfig</span><span class="p">(</span><span class="s2">&quot;menuminscrollheight&quot;</span><span class="p">,</span> <span class="p">{</span>
        
                <span class="nx">value</span><span class="o">:</span> <span class="p">(</span><span class="nx">oAttributes</span><span class="p">.</span><span class="nx">menuminscrollheight</span> <span class="o">||</span> <span class="mi">90</span><span class="p">),</span>
                <span class="nx">validator</span><span class="o">:</span> <span class="nx">Lang</span><span class="p">.</span><span class="nx">isNumber</span>
        
            <span class="p">});</span>


            <span class="cm">/**</span>
<span class="cm">            * @attribute menumaxheight</span>
<span class="cm">			* @description Number defining the maximum height (in pixels) for a menu&#39;s </span>
<span class="cm">			* body element (&lt;code&gt;&amp;#60;div class=&quot;bd&quot;&amp;#60;&lt;/code&gt;).  Once a menu&#39;s body </span>
<span class="cm">			* exceeds this height, the contents of the body are scrolled to maintain </span>
<span class="cm">			* this value.  This value cannot be set lower than the value of the </span>
<span class="cm">			* &quot;minscrollheight&quot; configuration property.</span>
<span class="cm">            * @type Number</span>
<span class="cm">            * @default 0</span>
<span class="cm">            */</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">setAttributeConfig</span><span class="p">(</span><span class="s2">&quot;menumaxheight&quot;</span><span class="p">,</span> <span class="p">{</span>
        
                <span class="nx">value</span><span class="o">:</span> <span class="p">(</span><span class="nx">oAttributes</span><span class="p">.</span><span class="nx">menumaxheight</span> <span class="o">||</span> <span class="mi">0</span><span class="p">),</span>
                <span class="nx">validator</span><span class="o">:</span> <span class="nx">Lang</span><span class="p">.</span><span class="nx">isNumber</span>
        
            <span class="p">});</span>


            <span class="cm">/**</span>
<span class="cm">            * @attribute menualignment</span>
<span class="cm">			* @description Array defining how the Button&#39;s Menu is aligned to the Button.  </span>
<span class="cm">            * The default value of [&quot;tl&quot;, &quot;bl&quot;] aligns the Menu&#39;s top left corner to the Button&#39;s </span>
<span class="cm">            * bottom left corner.</span>
<span class="cm">            * @type Array</span>
<span class="cm">            * @default [&quot;tl&quot;, &quot;bl&quot;]</span>
<span class="cm">            */</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">setAttributeConfig</span><span class="p">(</span><span class="s2">&quot;menualignment&quot;</span><span class="p">,</span> <span class="p">{</span>
        
                <span class="nx">value</span><span class="o">:</span> <span class="p">(</span><span class="nx">oAttributes</span><span class="p">.</span><span class="nx">menualignment</span> <span class="o">||</span> <span class="p">[</span><span class="s2">&quot;tl&quot;</span><span class="p">,</span> <span class="s2">&quot;bl&quot;</span><span class="p">]),</span>
                <span class="nx">validator</span><span class="o">:</span> <span class="nx">Lang</span><span class="p">.</span><span class="nx">isArray</span>
        
            <span class="p">});</span>
            

            <span class="cm">/**</span>
<span class="cm">            * @attribute selectedMenuItem</span>
<span class="cm">            * @description Object representing the item in the button&#39;s menu </span>
<span class="cm">            * that is currently selected.</span>
<span class="cm">            * @type YAHOO.widget.MenuItem</span>
<span class="cm">            * @default null</span>
<span class="cm">            */</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">setAttributeConfig</span><span class="p">(</span><span class="s2">&quot;selectedMenuItem&quot;</span><span class="p">,</span> <span class="p">{</span>
        
                <span class="nx">value</span><span class="o">:</span> <span class="kc">null</span>
        
            <span class="p">});</span>
        
        
            <span class="cm">/**</span>
<span class="cm">            * @attribute onclick</span>
<span class="cm">            * @description Object literal representing the code to be executed  </span>
<span class="cm">            * when the button is clicked.  Format:&lt;br&gt; &lt;code&gt; {&lt;br&gt; </span>
<span class="cm">            * &lt;strong&gt;fn:&lt;/strong&gt; Function,   &amp;#47;&amp;#47; The handler to call </span>
<span class="cm">            * when the event fires.&lt;br&gt; &lt;strong&gt;obj:&lt;/strong&gt; Object, </span>
<span class="cm">            * &amp;#47;&amp;#47; An object to pass back to the handler.&lt;br&gt; </span>
<span class="cm">            * &lt;strong&gt;scope:&lt;/strong&gt; Object &amp;#47;&amp;#47;  The object to use </span>
<span class="cm">            * for the scope of the handler.&lt;br&gt; } &lt;/code&gt;</span>
<span class="cm">            * @type Object</span>
<span class="cm">            * @default null</span>
<span class="cm">            */</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">setAttributeConfig</span><span class="p">(</span><span class="s2">&quot;onclick&quot;</span><span class="p">,</span> <span class="p">{</span>
        
                <span class="nx">value</span><span class="o">:</span> <span class="nx">oAttributes</span><span class="p">.</span><span class="nx">onclick</span><span class="p">,</span>
                <span class="nx">method</span><span class="o">:</span> <span class="k">this</span><span class="p">.</span><span class="nx">_setOnClick</span>
            
            <span class="p">});</span>


            <span class="cm">/**</span>
<span class="cm">            * @attribute focusmenu</span>
<span class="cm">            * @description Boolean indicating whether or not the button&#39;s menu </span>
<span class="cm">            * should be focused when it is made visible.</span>
<span class="cm">            * @type Boolean</span>
<span class="cm">            * @default true</span>
<span class="cm">            */</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">setAttributeConfig</span><span class="p">(</span><span class="s2">&quot;focusmenu&quot;</span><span class="p">,</span> <span class="p">{</span>
        
                <span class="nx">value</span><span class="o">:</span> <span class="p">(</span><span class="nx">oAttributes</span><span class="p">.</span><span class="nx">focusmenu</span> <span class="o">===</span> <span class="kc">false</span> <span class="o">?</span> <span class="kc">false</span> <span class="o">:</span> <span class="kc">true</span><span class="p">),</span>
                <span class="nx">validator</span><span class="o">:</span> <span class="nx">Lang</span><span class="p">.</span><span class="nx">isBoolean</span>
        
            <span class="p">});</span>


            <span class="cm">/**</span>
<span class="cm">            * @attribute replaceLabel</span>
<span class="cm">            * @description Boolean indicating whether or not the text of the </span>
<span class="cm">			* button&#39;s &lt;code&gt;&amp;#60;label&amp;#62;&lt;/code&gt; element should be used as</span>
<span class="cm">			* the source for the button&#39;s label configuration attribute and </span>
<span class="cm">			* removed from the DOM.</span>
<span class="cm">            * @type Boolean</span>
<span class="cm">            * @default false</span>
<span class="cm">            */</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">setAttributeConfig</span><span class="p">(</span><span class="s2">&quot;replaceLabel&quot;</span><span class="p">,</span> <span class="p">{</span>
        
                <span class="nx">value</span><span class="o">:</span> <span class="kc">false</span><span class="p">,</span>
                <span class="nx">validator</span><span class="o">:</span> <span class="nx">Lang</span><span class="p">.</span><span class="nx">isBoolean</span><span class="p">,</span>
                <span class="nx">writeOnce</span><span class="o">:</span> <span class="kc">true</span>
        
            <span class="p">});</span>

        <span class="p">},</span>
        
        
        <span class="cm">/**</span>
<span class="cm">        * @method focus</span>
<span class="cm">        * @description Causes the button to receive the focus and fires the </span>
<span class="cm">        * button&#39;s &quot;focus&quot; event.</span>
<span class="cm">        */</span>
        <span class="nx">focus</span><span class="o">:</span> <span class="kd">function</span> <span class="p">()</span> <span class="p">{</span>
        
            <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;disabled&quot;</span><span class="p">))</span> <span class="p">{</span>
                <span class="c1">//Adding a try/catch in case the element is not</span>
                <span class="c1">//  visible by the time it&#39;s focus is being called.</span>
                <span class="c1">//  for example, on a dialog that closes on button click</span>
                <span class="k">try</span> <span class="p">{</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">_button</span><span class="p">.</span><span class="nx">focus</span><span class="p">();</span>
                <span class="p">}</span> <span class="k">catch</span> <span class="p">(</span><span class="nx">e</span><span class="p">)</span> <span class="p">{}</span>
            
            <span class="p">}</span>
        
        <span class="p">},</span>
        
        
        <span class="cm">/**</span>
<span class="cm">        * @method blur</span>
<span class="cm">        * @description Causes the button to lose focus and fires the button&#39;s</span>
<span class="cm">        * &quot;blur&quot; event.</span>
<span class="cm">        */</span>
        <span class="nx">blur</span><span class="o">:</span> <span class="kd">function</span> <span class="p">()</span> <span class="p">{</span>
        
            <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;disabled&quot;</span><span class="p">))</span> <span class="p">{</span>
                <span class="c1">//Adding a try/catch in case the element is not</span>
                <span class="c1">//  visible by the time it&#39;s focus is being called.</span>
                <span class="c1">//  for example, on a dialog that closes on button click</span>
                <span class="k">try</span> <span class="p">{</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">_button</span><span class="p">.</span><span class="nx">blur</span><span class="p">();</span>
                <span class="p">}</span> <span class="k">catch</span> <span class="p">(</span><span class="nx">e</span><span class="p">)</span> <span class="p">{}</span>
        
            <span class="p">}</span>
        
        <span class="p">},</span>
        
        
        <span class="cm">/**</span>
<span class="cm">        * @method hasFocus</span>
<span class="cm">        * @description Returns a boolean indicating whether or not the button </span>
<span class="cm">        * has focus.</span>
<span class="cm">        * @return {Boolean}</span>
<span class="cm">        */</span>
        <span class="nx">hasFocus</span><span class="o">:</span> <span class="kd">function</span> <span class="p">()</span> <span class="p">{</span>
        
            <span class="k">return</span> <span class="p">(</span><span class="nx">m_oFocusedButton</span> <span class="o">==</span> <span class="k">this</span><span class="p">);</span>
        
        <span class="p">},</span>
        
        
        <span class="cm">/**</span>
<span class="cm">        * @method isActive</span>
<span class="cm">        * @description Returns a boolean indicating whether or not the button </span>
<span class="cm">        * is active.</span>
<span class="cm">        * @return {Boolean}</span>
<span class="cm">        */</span>
        <span class="nx">isActive</span><span class="o">:</span> <span class="kd">function</span> <span class="p">()</span> <span class="p">{</span>
        
            <span class="k">return</span> <span class="k">this</span><span class="p">.</span><span class="nx">hasClass</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">CLASS_NAME_PREFIX</span> <span class="o">+</span> <span class="k">this</span><span class="p">.</span><span class="nx">CSS_CLASS_NAME</span> <span class="o">+</span> <span class="s2">&quot;-active&quot;</span><span class="p">);</span>
        
        <span class="p">},</span>
        
        
        <span class="cm">/**</span>
<span class="cm">        * @method getMenu</span>
<span class="cm">        * @description Returns a reference to the button&#39;s menu.</span>
<span class="cm">        * @return {&lt;a href=&quot;YAHOO.widget.Overlay.html&quot;&gt;</span>
<span class="cm">        * YAHOO.widget.Overlay&lt;/a&gt;|&lt;a </span>
<span class="cm">        * href=&quot;YAHOO.widget.Menu.html&quot;&gt;YAHOO.widget.Menu&lt;/a&gt;}</span>
<span class="cm">        */</span>
        <span class="nx">getMenu</span><span class="o">:</span> <span class="kd">function</span> <span class="p">()</span> <span class="p">{</span>
        
            <span class="k">return</span> <span class="k">this</span><span class="p">.</span><span class="nx">_menu</span><span class="p">;</span>
        
        <span class="p">},</span>
        
        
        <span class="cm">/**</span>
<span class="cm">        * @method getForm</span>
<span class="cm">        * @description Returns a reference to the button&#39;s parent form.</span>
<span class="cm">        * @return {&lt;a href=&quot;http://www.w3.org/TR/2000/WD-DOM-Level-1-</span>
<span class="cm">        * 20000929/level-one-html.html#ID-40002357&quot;&gt;HTMLFormElement&lt;/a&gt;}</span>
<span class="cm">        */</span>
        <span class="nx">getForm</span><span class="o">:</span> <span class="kd">function</span> <span class="p">()</span> <span class="p">{</span>
        
        	<span class="kd">var</span> <span class="nx">oButton</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_button</span><span class="p">,</span>
        		<span class="nx">oForm</span><span class="p">;</span>
        
            <span class="k">if</span> <span class="p">(</span><span class="nx">oButton</span><span class="p">)</span> <span class="p">{</span>
            
            	<span class="nx">oForm</span> <span class="o">=</span> <span class="nx">oButton</span><span class="p">.</span><span class="nx">form</span><span class="p">;</span>
            
            <span class="p">}</span>
        
        	<span class="k">return</span> <span class="nx">oForm</span><span class="p">;</span>
        
        <span class="p">},</span>
        
        
        <span class="cm">/** </span>
<span class="cm">        * @method getHiddenFields</span>
<span class="cm">        * @description Returns an &lt;code&gt;&amp;#60;input&amp;#62;&lt;/code&gt; element or </span>
<span class="cm">        * array of form elements used to represent the button when its parent </span>
<span class="cm">        * form is submitted.  </span>
<span class="cm">        * @return {&lt;a href=&quot;http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/</span>
<span class="cm">        * level-one-html.html#ID-6043025&quot;&gt;HTMLInputElement&lt;/a&gt;|Array}</span>
<span class="cm">        */</span>
        <span class="nx">getHiddenFields</span><span class="o">:</span> <span class="kd">function</span> <span class="p">()</span> <span class="p">{</span>
        
            <span class="k">return</span> <span class="k">this</span><span class="p">.</span><span class="nx">_hiddenFields</span><span class="p">;</span>
        
        <span class="p">},</span>
        
        
        <span class="cm">/**</span>
<span class="cm">        * @method destroy</span>
<span class="cm">        * @description Removes the button&#39;s element from its parent element and </span>
<span class="cm">        * removes all event handlers.</span>
<span class="cm">        */</span>
        <span class="nx">destroy</span><span class="o">:</span> <span class="kd">function</span> <span class="p">()</span> <span class="p">{</span>
        
            <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Destroying ...&quot;</span><span class="p">,</span> <span class="s2">&quot;info&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
        
            <span class="kd">var</span> <span class="nx">oElement</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;element&quot;</span><span class="p">),</span>
                <span class="nx">oMenu</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_menu</span><span class="p">,</span>
				<span class="nx">oLabel</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_label</span><span class="p">,</span>
                <span class="nx">oParentNode</span><span class="p">,</span>
                <span class="nx">aButtons</span><span class="p">;</span>
        
            <span class="k">if</span> <span class="p">(</span><span class="nx">oMenu</span><span class="p">)</span> <span class="p">{</span>
        
                <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Destroying menu.&quot;</span><span class="p">,</span> <span class="s2">&quot;info&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>

                <span class="k">if</span> <span class="p">(</span><span class="nx">m_oOverlayManager</span> <span class="o">&amp;&amp;</span> <span class="nx">m_oOverlayManager</span><span class="p">.</span><span class="nx">find</span><span class="p">(</span><span class="nx">oMenu</span><span class="p">))</span> <span class="p">{</span>

                    <span class="nx">m_oOverlayManager</span><span class="p">.</span><span class="nx">remove</span><span class="p">(</span><span class="nx">oMenu</span><span class="p">);</span>

                <span class="p">}</span>
        
                <span class="nx">oMenu</span><span class="p">.</span><span class="nx">destroy</span><span class="p">();</span>
        
            <span class="p">}</span>
        
            <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Removing DOM event listeners.&quot;</span><span class="p">,</span> <span class="s2">&quot;info&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
        
            <span class="nx">Event</span><span class="p">.</span><span class="nx">purgeElement</span><span class="p">(</span><span class="nx">oElement</span><span class="p">);</span>
            <span class="nx">Event</span><span class="p">.</span><span class="nx">purgeElement</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_button</span><span class="p">);</span>
            <span class="nx">Event</span><span class="p">.</span><span class="nx">removeListener</span><span class="p">(</span><span class="nb">document</span><span class="p">,</span> <span class="s2">&quot;mouseup&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_onDocumentMouseUp</span><span class="p">);</span>
            <span class="nx">Event</span><span class="p">.</span><span class="nx">removeListener</span><span class="p">(</span><span class="nb">document</span><span class="p">,</span> <span class="s2">&quot;keyup&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_onDocumentKeyUp</span><span class="p">);</span>
            <span class="nx">Event</span><span class="p">.</span><span class="nx">removeListener</span><span class="p">(</span><span class="nb">document</span><span class="p">,</span> <span class="s2">&quot;mousedown&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_onDocumentMouseDown</span><span class="p">);</span>


			<span class="k">if</span> <span class="p">(</span><span class="nx">oLabel</span><span class="p">)</span> <span class="p">{</span>

            	<span class="nx">Event</span><span class="p">.</span><span class="nx">removeListener</span><span class="p">(</span><span class="nx">oLabel</span><span class="p">,</span> <span class="s2">&quot;click&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_onLabelClick</span><span class="p">);</span>
				
				<span class="nx">oParentNode</span> <span class="o">=</span> <span class="nx">oLabel</span><span class="p">.</span><span class="nx">parentNode</span><span class="p">;</span>
				<span class="nx">oParentNode</span><span class="p">.</span><span class="nx">removeChild</span><span class="p">(</span><span class="nx">oLabel</span><span class="p">);</span>
				
			<span class="p">}</span>
        
        
            <span class="kd">var</span> <span class="nx">oForm</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getForm</span><span class="p">();</span>
            
            <span class="k">if</span> <span class="p">(</span><span class="nx">oForm</span><span class="p">)</span> <span class="p">{</span>
        
                <span class="nx">Event</span><span class="p">.</span><span class="nx">removeListener</span><span class="p">(</span><span class="nx">oForm</span><span class="p">,</span> <span class="s2">&quot;reset&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_onFormReset</span><span class="p">);</span>
                <span class="nx">Event</span><span class="p">.</span><span class="nx">removeListener</span><span class="p">(</span><span class="nx">oForm</span><span class="p">,</span> <span class="s2">&quot;submit&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_onFormSubmit</span><span class="p">);</span>
        
            <span class="p">}</span>

            <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Removing CustomEvent listeners.&quot;</span><span class="p">,</span> <span class="s2">&quot;info&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>

            <span class="k">this</span><span class="p">.</span><span class="nx">unsubscribeAll</span><span class="p">();</span>

			<span class="nx">oParentNode</span> <span class="o">=</span> <span class="nx">oElement</span><span class="p">.</span><span class="nx">parentNode</span><span class="p">;</span>

            <span class="k">if</span> <span class="p">(</span><span class="nx">oParentNode</span><span class="p">)</span> <span class="p">{</span>

                <span class="nx">oParentNode</span><span class="p">.</span><span class="nx">removeChild</span><span class="p">(</span><span class="nx">oElement</span><span class="p">);</span>
            
            <span class="p">}</span>
        
            <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Removing from document.&quot;</span><span class="p">,</span> <span class="s2">&quot;info&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
        
            <span class="k">delete</span> <span class="nx">m_oButtons</span><span class="p">[</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;id&quot;</span><span class="p">)];</span>

			<span class="kd">var</span> <span class="nx">sClass</span> <span class="o">=</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">CLASS_NAME_PREFIX</span> <span class="o">+</span> <span class="k">this</span><span class="p">.</span><span class="nx">CSS_CLASS_NAME</span><span class="p">);</span>

            <span class="nx">aButtons</span> <span class="o">=</span> <span class="nx">Dom</span><span class="p">.</span><span class="nx">getElementsByClassName</span><span class="p">(</span><span class="nx">sClass</span><span class="p">,</span> 
                                <span class="k">this</span><span class="p">.</span><span class="nx">NODE_NAME</span><span class="p">,</span> <span class="nx">oForm</span><span class="p">);</span> 

            <span class="k">if</span> <span class="p">(</span><span class="nx">Lang</span><span class="p">.</span><span class="nx">isArray</span><span class="p">(</span><span class="nx">aButtons</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="nx">aButtons</span><span class="p">.</span><span class="nx">length</span> <span class="o">===</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>

                <span class="nx">Event</span><span class="p">.</span><span class="nx">removeListener</span><span class="p">(</span><span class="nx">oForm</span><span class="p">,</span> <span class="s2">&quot;keypress&quot;</span><span class="p">,</span> 
                        <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">widget</span><span class="p">.</span><span class="nx">Button</span><span class="p">.</span><span class="nx">onFormKeyPress</span><span class="p">);</span>

            <span class="p">}</span>

            <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Destroyed.&quot;</span><span class="p">,</span> <span class="s2">&quot;info&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
        
        <span class="p">},</span>
        
        
        <span class="nx">fireEvent</span><span class="o">:</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">p_sType</span> <span class="p">,</span> <span class="nx">p_aArgs</span><span class="p">)</span> <span class="p">{</span>
        
			<span class="kd">var</span> <span class="nx">sType</span> <span class="o">=</span> <span class="nx">arguments</span><span class="p">[</span><span class="mi">0</span><span class="p">];</span>
		
			<span class="c1">//  Disabled buttons should not respond to DOM events</span>
		
			<span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">DOM_EVENTS</span><span class="p">[</span><span class="nx">sType</span><span class="p">]</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;disabled&quot;</span><span class="p">))</span> <span class="p">{</span>
		
				<span class="k">return</span> <span class="kc">false</span><span class="p">;</span>
		
			<span class="p">}</span>
		
			<span class="k">return</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">widget</span><span class="p">.</span><span class="nx">Button</span><span class="p">.</span><span class="nx">superclass</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">.</span><span class="nx">apply</span><span class="p">(</span><span class="k">this</span><span class="p">,</span> <span class="nx">arguments</span><span class="p">);</span>
        
        <span class="p">},</span>
        
        
        <span class="cm">/**</span>
<span class="cm">        * @method toString</span>
<span class="cm">        * @description Returns a string representing the button.</span>
<span class="cm">        * @return {String}</span>
<span class="cm">        */</span>
        <span class="nx">toString</span><span class="o">:</span> <span class="kd">function</span> <span class="p">()</span> <span class="p">{</span>
        
            <span class="k">return</span> <span class="p">(</span><span class="s2">&quot;Button &quot;</span> <span class="o">+</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;id&quot;</span><span class="p">));</span>
        
        <span class="p">}</span>
    
    <span class="p">});</span>
    
    
    <span class="cm">/**</span>
<span class="cm">    * @method YAHOO.widget.Button.onFormKeyPress</span>
<span class="cm">    * @description &quot;keypress&quot; event handler for the button&#39;s form.</span>
<span class="cm">    * @param {Event} p_oEvent Object representing the DOM event object passed </span>
<span class="cm">    * back by the event utility (YAHOO.util.Event).</span>
<span class="cm">    */</span>
    <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">widget</span><span class="p">.</span><span class="nx">Button</span><span class="p">.</span><span class="nx">onFormKeyPress</span> <span class="o">=</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">p_oEvent</span><span class="p">)</span> <span class="p">{</span>
    
        <span class="kd">var</span> <span class="nx">oTarget</span> <span class="o">=</span> <span class="nx">Event</span><span class="p">.</span><span class="nx">getTarget</span><span class="p">(</span><span class="nx">p_oEvent</span><span class="p">),</span>
            <span class="nx">nCharCode</span> <span class="o">=</span> <span class="nx">Event</span><span class="p">.</span><span class="nx">getCharCode</span><span class="p">(</span><span class="nx">p_oEvent</span><span class="p">),</span>
            <span class="nx">sNodeName</span> <span class="o">=</span> <span class="nx">oTarget</span><span class="p">.</span><span class="nx">nodeName</span> <span class="o">&amp;&amp;</span> <span class="nx">oTarget</span><span class="p">.</span><span class="nx">nodeName</span><span class="p">.</span><span class="nx">toUpperCase</span><span class="p">(),</span>
            <span class="nx">sType</span> <span class="o">=</span> <span class="nx">oTarget</span><span class="p">.</span><span class="nx">type</span><span class="p">,</span>
    
            <span class="cm">/*</span>
<span class="cm">                Boolean indicating if the form contains any enabled or </span>
<span class="cm">                disabled YUI submit buttons</span>
<span class="cm">            */</span>
    
            <span class="nx">bFormContainsYUIButtons</span> <span class="o">=</span> <span class="kc">false</span><span class="p">,</span>
    
            <span class="nx">oButton</span><span class="p">,</span>
    
            <span class="nx">oYUISubmitButton</span><span class="p">,</span>   <span class="c1">// The form&#39;s first, enabled YUI submit button</span>
    
            <span class="cm">/*</span>
<span class="cm">                 The form&#39;s first, enabled HTML submit button that precedes any </span>
<span class="cm">                 YUI submit button</span>
<span class="cm">            */</span>
    
            <span class="nx">oPrecedingSubmitButton</span><span class="p">,</span>
            
            <span class="nx">oEvent</span><span class="p">;</span> 
    
    
        <span class="kd">function</span> <span class="nx">isSubmitButton</span><span class="p">(</span><span class="nx">p_oElement</span><span class="p">)</span> <span class="p">{</span>
    
            <span class="kd">var</span> <span class="nx">sId</span><span class="p">,</span>
                <span class="nx">oSrcElement</span><span class="p">;</span>
    
            <span class="k">switch</span> <span class="p">(</span><span class="nx">p_oElement</span><span class="p">.</span><span class="nx">nodeName</span><span class="p">.</span><span class="nx">toUpperCase</span><span class="p">())</span> <span class="p">{</span>
    
            <span class="k">case</span> <span class="s2">&quot;INPUT&quot;</span><span class="o">:</span>
            <span class="k">case</span> <span class="s2">&quot;BUTTON&quot;</span><span class="o">:</span>
            
                <span class="k">if</span> <span class="p">(</span><span class="nx">p_oElement</span><span class="p">.</span><span class="nx">type</span> <span class="o">==</span> <span class="s2">&quot;submit&quot;</span> <span class="o">&amp;&amp;</span> <span class="o">!</span><span class="nx">p_oElement</span><span class="p">.</span><span class="nx">disabled</span><span class="p">)</span> <span class="p">{</span>
                    
                    <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">bFormContainsYUIButtons</span> <span class="o">&amp;&amp;</span> <span class="o">!</span><span class="nx">oPrecedingSubmitButton</span><span class="p">)</span> <span class="p">{</span>

                        <span class="nx">oPrecedingSubmitButton</span> <span class="o">=</span> <span class="nx">p_oElement</span><span class="p">;</span>

                    <span class="p">}</span>
                
                <span class="p">}</span>

                <span class="k">break</span><span class="p">;</span>
            

            <span class="k">default</span><span class="o">:</span>
            
                <span class="nx">sId</span> <span class="o">=</span> <span class="nx">p_oElement</span><span class="p">.</span><span class="nx">id</span><span class="p">;</span>
    
                <span class="k">if</span> <span class="p">(</span><span class="nx">sId</span><span class="p">)</span> <span class="p">{</span>
    
                    <span class="nx">oButton</span> <span class="o">=</span> <span class="nx">m_oButtons</span><span class="p">[</span><span class="nx">sId</span><span class="p">];</span>
        
                    <span class="k">if</span> <span class="p">(</span><span class="nx">oButton</span><span class="p">)</span> <span class="p">{</span>

                        <span class="nx">bFormContainsYUIButtons</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
        
                        <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">oButton</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;disabled&quot;</span><span class="p">))</span> <span class="p">{</span>

                            <span class="nx">oSrcElement</span> <span class="o">=</span> <span class="nx">oButton</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;srcelement&quot;</span><span class="p">);</span>
    
                            <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">oYUISubmitButton</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">oButton</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;type&quot;</span><span class="p">)</span> <span class="o">==</span> <span class="s2">&quot;submit&quot;</span> <span class="o">||</span> 
                                <span class="p">(</span><span class="nx">oSrcElement</span> <span class="o">&amp;&amp;</span> <span class="nx">oSrcElement</span><span class="p">.</span><span class="nx">type</span> <span class="o">==</span> <span class="s2">&quot;submit&quot;</span><span class="p">)))</span> <span class="p">{</span>

                                <span class="nx">oYUISubmitButton</span> <span class="o">=</span> <span class="nx">oButton</span><span class="p">;</span>
                            
                            <span class="p">}</span>
                        
                        <span class="p">}</span>
                        
                    <span class="p">}</span>
                
                <span class="p">}</span>

                <span class="k">break</span><span class="p">;</span>
    
            <span class="p">}</span>
    
        <span class="p">}</span>
    
    
        <span class="k">if</span> <span class="p">(</span><span class="nx">nCharCode</span> <span class="o">==</span> <span class="mi">13</span> <span class="o">&amp;&amp;</span> <span class="p">((</span><span class="nx">sNodeName</span> <span class="o">==</span> <span class="s2">&quot;INPUT&quot;</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">sType</span> <span class="o">==</span> <span class="s2">&quot;text&quot;</span> <span class="o">||</span> 
            <span class="nx">sType</span> <span class="o">==</span> <span class="s2">&quot;password&quot;</span> <span class="o">||</span> <span class="nx">sType</span> <span class="o">==</span> <span class="s2">&quot;checkbox&quot;</span> <span class="o">||</span> <span class="nx">sType</span> <span class="o">==</span> <span class="s2">&quot;radio&quot;</span> <span class="o">||</span> 
            <span class="nx">sType</span> <span class="o">==</span> <span class="s2">&quot;file&quot;</span><span class="p">))</span> <span class="o">||</span> <span class="nx">sNodeName</span> <span class="o">==</span> <span class="s2">&quot;SELECT&quot;</span><span class="p">))</span> <span class="p">{</span>
    
            <span class="nx">Dom</span><span class="p">.</span><span class="nx">getElementsBy</span><span class="p">(</span><span class="nx">isSubmitButton</span><span class="p">,</span> <span class="s2">&quot;*&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">);</span>
    
    
            <span class="k">if</span> <span class="p">(</span><span class="nx">oPrecedingSubmitButton</span><span class="p">)</span> <span class="p">{</span>
    
                <span class="cm">/*</span>
<span class="cm">                     Need to set focus to the first enabled submit button</span>
<span class="cm">                     to make sure that IE includes its name and value </span>
<span class="cm">                     in the form&#39;s data set.</span>
<span class="cm">                */</span>
    
                <span class="nx">oPrecedingSubmitButton</span><span class="p">.</span><span class="nx">focus</span><span class="p">();</span>
            
            <span class="p">}</span>
            <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">oPrecedingSubmitButton</span> <span class="o">&amp;&amp;</span> <span class="nx">oYUISubmitButton</span><span class="p">)</span> <span class="p">{</span>
    
				<span class="cm">/*</span>
<span class="cm">					Need to call &quot;preventDefault&quot; to ensure that the form doesn&#39;t end up getting</span>
<span class="cm">					submitted twice.</span>
<span class="cm">				*/</span>
    
    			<span class="nx">Event</span><span class="p">.</span><span class="nx">preventDefault</span><span class="p">(</span><span class="nx">p_oEvent</span><span class="p">);</span>


				<span class="k">if</span> <span class="p">(</span><span class="nx">UA</span><span class="p">.</span><span class="nx">ie</span><span class="p">)</span> <span class="p">{</span>
				
					<span class="nx">oYUISubmitButton</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;element&quot;</span><span class="p">).</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;onclick&quot;</span><span class="p">);</span>
				
				<span class="p">}</span>
				<span class="k">else</span> <span class="p">{</span>

					<span class="nx">oEvent</span> <span class="o">=</span> <span class="nb">document</span><span class="p">.</span><span class="nx">createEvent</span><span class="p">(</span><span class="s2">&quot;HTMLEvents&quot;</span><span class="p">);</span>
					<span class="nx">oEvent</span><span class="p">.</span><span class="nx">initEvent</span><span class="p">(</span><span class="s2">&quot;click&quot;</span><span class="p">,</span> <span class="kc">true</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span>
			

					<span class="k">if</span> <span class="p">(</span><span class="nx">UA</span><span class="p">.</span><span class="nx">gecko</span> <span class="o">&lt;</span> <span class="mf">1.9</span><span class="p">)</span> <span class="p">{</span>
					
						<span class="nx">oYUISubmitButton</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;click&quot;</span><span class="p">,</span> <span class="nx">oEvent</span><span class="p">);</span>
					
					<span class="p">}</span>
					<span class="k">else</span> <span class="p">{</span>

						<span class="nx">oYUISubmitButton</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;element&quot;</span><span class="p">).</span><span class="nx">dispatchEvent</span><span class="p">(</span><span class="nx">oEvent</span><span class="p">);</span>
					
					<span class="p">}</span>
  
                <span class="p">}</span>

            <span class="p">}</span>
            
        <span class="p">}</span>
    
    <span class="p">};</span>
    
    
    <span class="cm">/**</span>
<span class="cm">    * @method YAHOO.widget.Button.addHiddenFieldsToForm</span>
<span class="cm">    * @description Searches the specified form and adds hidden fields for  </span>
<span class="cm">    * instances of YAHOO.widget.Button that are of type &quot;radio,&quot; &quot;checkbox,&quot; </span>
<span class="cm">    * &quot;menu,&quot; and &quot;split.&quot;</span>
<span class="cm">    * @param {&lt;a href=&quot;http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-</span>
<span class="cm">    * one-html.html#ID-40002357&quot;&gt;HTMLFormElement&lt;/a&gt;} p_oForm Object reference </span>
<span class="cm">    * for the form to search.</span>
<span class="cm">    */</span>
    <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">widget</span><span class="p">.</span><span class="nx">Button</span><span class="p">.</span><span class="nx">addHiddenFieldsToForm</span> <span class="o">=</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">p_oForm</span><span class="p">)</span> <span class="p">{</span>
    
        <span class="kd">var</span> <span class="nx">proto</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">widget</span><span class="p">.</span><span class="nx">Button</span><span class="p">.</span><span class="nx">prototype</span><span class="p">,</span>
			<span class="nx">aButtons</span> <span class="o">=</span> <span class="nx">Dom</span><span class="p">.</span><span class="nx">getElementsByClassName</span><span class="p">(</span>
							<span class="p">(</span><span class="nx">proto</span><span class="p">.</span><span class="nx">CLASS_NAME_PREFIX</span> <span class="o">+</span> <span class="nx">proto</span><span class="p">.</span><span class="nx">CSS_CLASS_NAME</span><span class="p">),</span> 
                            <span class="s2">&quot;*&quot;</span><span class="p">,</span> 
                            <span class="nx">p_oForm</span><span class="p">),</span>
    
            <span class="nx">nButtons</span> <span class="o">=</span> <span class="nx">aButtons</span><span class="p">.</span><span class="nx">length</span><span class="p">,</span>
            <span class="nx">oButton</span><span class="p">,</span>
            <span class="nx">sId</span><span class="p">,</span>
            <span class="nx">i</span><span class="p">;</span>
    
        <span class="k">if</span> <span class="p">(</span><span class="nx">nButtons</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
    
            <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Form contains &quot;</span> <span class="o">+</span> <span class="nx">nButtons</span> <span class="o">+</span> <span class="s2">&quot; YUI buttons.&quot;</span><span class="p">,</span> <span class="s2">&quot;info&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
    
            <span class="k">for</span> <span class="p">(</span><span class="nx">i</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="nx">i</span> <span class="o">&lt;</span> <span class="nx">nButtons</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
    
                <span class="nx">sId</span> <span class="o">=</span> <span class="nx">aButtons</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">id</span><span class="p">;</span>
    
                <span class="k">if</span> <span class="p">(</span><span class="nx">sId</span><span class="p">)</span> <span class="p">{</span>
    
                    <span class="nx">oButton</span> <span class="o">=</span> <span class="nx">m_oButtons</span><span class="p">[</span><span class="nx">sId</span><span class="p">];</span>
        
                    <span class="k">if</span> <span class="p">(</span><span class="nx">oButton</span><span class="p">)</span> <span class="p">{</span>
           
                        <span class="nx">oButton</span><span class="p">.</span><span class="nx">createHiddenFields</span><span class="p">();</span>
                        
                    <span class="p">}</span>
                
                <span class="p">}</span>
            
            <span class="p">}</span>
    
        <span class="p">}</span>
    
    <span class="p">};</span>
    

    <span class="cm">/**</span>
<span class="cm">    * @method YAHOO.widget.Button.getButton</span>
<span class="cm">    * @description Returns a button with the specified id.</span>
<span class="cm">    * @param {String} p_sId String specifying the id of the root node of the </span>
<span class="cm">    * HTML element representing the button to be retrieved.</span>
<span class="cm">    * @return {YAHOO.widget.Button}</span>
<span class="cm">    */</span>
    <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">widget</span><span class="p">.</span><span class="nx">Button</span><span class="p">.</span><span class="nx">getButton</span> <span class="o">=</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">p_sId</span><span class="p">)</span> <span class="p">{</span>

		<span class="k">return</span> <span class="nx">m_oButtons</span><span class="p">[</span><span class="nx">p_sId</span><span class="p">];</span>

    <span class="p">};</span>
    
    
    <span class="c1">// Events</span>
    
    
    <span class="cm">/**</span>
<span class="cm">    * @event focus</span>
<span class="cm">    * @description Fires when the menu item receives focus.  Passes back a  </span>
<span class="cm">    * single object representing the original DOM event object passed back by </span>
<span class="cm">    * the event utility (YAHOO.util.Event) when the event was fired.  See </span>
<span class="cm">    * &lt;a href=&quot;YAHOO.util.Element.html#addListener&quot;&gt;Element.addListener&lt;/a&gt; </span>
<span class="cm">    * for more information on listening for this event.</span>
<span class="cm">    * @type YAHOO.util.CustomEvent</span>
<span class="cm">    */</span>
    
    
    <span class="cm">/**</span>
<span class="cm">    * @event blur</span>
<span class="cm">    * @description Fires when the menu item loses the input focus.  Passes back  </span>
<span class="cm">    * a single object representing the original DOM event object passed back by </span>
<span class="cm">    * the event utility (YAHOO.util.Event) when the event was fired.  See </span>
<span class="cm">    * &lt;a href=&quot;YAHOO.util.Element.html#addListener&quot;&gt;Element.addListener&lt;/a&gt; for  </span>
<span class="cm">    * more information on listening for this event.</span>
<span class="cm">    * @type YAHOO.util.CustomEvent</span>
<span class="cm">    */</span>
    
    
    <span class="cm">/**</span>
<span class="cm">    * @event option</span>
<span class="cm">    * @description Fires when the user invokes the button&#39;s option.  Passes </span>
<span class="cm">    * back a single object representing the original DOM event (either </span>
<span class="cm">    * &quot;mousedown&quot; or &quot;keydown&quot;) that caused the &quot;option&quot; event to fire.  See </span>
<span class="cm">    * &lt;a href=&quot;YAHOO.util.Element.html#addListener&quot;&gt;Element.addListener&lt;/a&gt; </span>
<span class="cm">    * for more information on listening for this event.</span>
<span class="cm">    * @type YAHOO.util.CustomEvent</span>
<span class="cm">    */</span>

<span class="p">})();</span>
</pre></div>

                    </div>
			</div>
		</div>
		<div class="yui-b">
            <div class="nav">

                    <div id="moduleList" class="module">
                        <h4>Modules</h4>
                        <ul class="content">
                                <li class=""><a href="module_animation.html" title="animation">animation</a></li>
                                <li class=""><a href="module_autocomplete.html" title="autocomplete">autocomplete</a></li>
                                <li class="selected"><a href="module_button.html" title="button">button</a></li>
                                <li class=""><a href="module_calendar.html" title="calendar">calendar</a></li>
                                <li class=""><a href="module_carousel.html" title="carousel">carousel</a></li>
                                <li class=""><a href="module_charts.html" title="charts">charts</a></li>
                                <li class=""><a href="module_colorpicker.html" title="colorpicker">colorpicker</a></li>
                                <li class=""><a href="module_connection.html" title="connection">connection</a></li>
                                <li class=""><a href="module_container.html" title="container">container</a></li>
                                <li class=""><a href="module_cookie.html" title="cookie">cookie</a></li>
                                <li class=""><a href="module_datasource.html" title="datasource">datasource</a></li>
                                <li class=""><a href="module_datatable.html" title="datatable">datatable</a></li>
                                <li class=""><a href="module_datemath.html" title="datemath">datemath</a></li>
                                <li class=""><a href="module_dom.html" title="dom">dom</a></li>
                                <li class=""><a href="module_dragdrop.html" title="dragdrop">dragdrop</a></li>
                                <li class=""><a href="module_editor.html" title="editor">editor</a></li>
                                <li class=""><a href="module_element.html" title="element">element</a></li>
                                <li class=""><a href="module_element-delegate.html" title="element-delegate">element-delegate</a></li>
                                <li class=""><a href="module_event.html" title="event">event</a></li>
                                <li class=""><a href="module_event-delegate.html" title="event-delegate">event-delegate</a></li>
                                <li class=""><a href="module_event-mouseenter.html" title="event-mouseenter">event-mouseenter</a></li>
                                <li class=""><a href="module_event-simulate.html" title="event-simulate">event-simulate</a></li>
                                <li class=""><a href="module_get.html" title="get">get</a></li>
                                <li class=""><a href="module_history.html" title="history">history</a></li>
                                <li class=""><a href="module_imagecropper.html" title="imagecropper">imagecropper</a></li>
                                <li class=""><a href="module_imageloader.html" title="imageloader">imageloader</a></li>
                                <li class=""><a href="module_json.html" title="json">json</a></li>
                                <li class=""><a href="module_layout.html" title="layout">layout</a></li>
                                <li class=""><a href="module_logger.html" title="logger">logger</a></li>
                                <li class=""><a href="module_menu.html" title="menu">menu</a></li>
                                <li class=""><a href="module_paginator.html" title="paginator">paginator</a></li>
                                <li class=""><a href="module_profiler.html" title="profiler">profiler</a></li>
                                <li class=""><a href="module_profilerviewer.html" title="profilerviewer">profilerviewer</a></li>
                                <li class=""><a href="module_progressbar.html" title="progressbar">progressbar</a></li>
                                <li class=""><a href="module_resize.html" title="resize">resize</a></li>
                                <li class=""><a href="module_selector.html" title="selector">selector</a></li>
                                <li class=""><a href="module_slider.html" title="slider">slider</a></li>
                                <li class=""><a href="module_storage.html" title="Storage">Storage</a></li>
                                <li class=""><a href="module_stylesheet.html" title="stylesheet">stylesheet</a></li>
                                <li class=""><a href="module_swf.html" title="swf">swf</a></li>
                                <li class=""><a href="module_swfdetect.html" title="swfdetect">swfdetect</a></li>
                                <li class=""><a href="module_swfstore.html" title="swfstore">swfstore</a></li>
                                <li class=""><a href="module_tabview.html" title="tabview">tabview</a></li>
                                <li class=""><a href="module_treeview.html" title="treeview">treeview</a></li>
                                <li class=""><a href="module_uploader.html" title="uploader">uploader</a></li>
                                <li class=""><a href="module_yahoo.html" title="yahoo">yahoo</a></li>
                                <li class=""><a href="module_yuiloader.html" title="yuiloader">yuiloader</a></li>
                                <li class=""><a href="module_yuitest.html" title="yuitest">yuitest</a></li>
                        </ul>
                    </div>

                    <div id="classList" class="module">
                        <h4>Classes</h4>
                        <ul class="content">
                                <li class=""><a href="YAHOO.widget.Button.html" title="YAHOO.widget.Button">YAHOO.widget.Button</a></li>
                                <li class=""><a href="YAHOO.widget.ButtonGroup.html" title="YAHOO.widget.ButtonGroup">YAHOO.widget.ButtonGroup</a></li>
                        </ul>
                    </div>

                    <div id="fileList" class="module">
                        <h4>Files</h4>
                        <ul class="content">        
                                <li class="selected"><a href="button.js.html" title="button.js">button.js</a></li>
                                <li class=""><a href="buttongroup.js.html" title="buttongroup.js">buttongroup.js</a></li>
                        </ul>
                    </div>





            </div>
		</div>
	</div>
	<div id="ft">
        <hr />
        Copyright &copy; 2011 Yahoo! Inc. All rights reserved.
	</div>
</div>
<script type="text/javascript">

    var ALL_YUI_PROPS = [{"access": "protected", "host": "YAHOO.widget.Button", "name": "_activationButtonPressed", "url": "YAHOO.widget.Button.html#property__activationButtonPressed", "type": "property"}, {"access": "protected", "host": "YAHOO.widget.Button", "name": "_activationKeyPressed", "url": "YAHOO.widget.Button.html#property__activationKeyPressed", "type": "property"}, {"access": "", "host": "YAHOO.widget.Button", "name": "ACTIVATION_KEYS", "url": "YAHOO.widget.Button.html#property_ACTIVATION_KEYS", "type": "property"}, {"access": "", "host": "YAHOO.widget.ButtonGroup", "name": "addButton", "url": "YAHOO.widget.ButtonGroup.html#method_addButton", "type": "method"}, {"access": "", "host": "YAHOO.widget.ButtonGroup", "name": "addButtons", "url": "YAHOO.widget.ButtonGroup.html#method_addButtons", "type": "method"}, {"access": "protected", "host": "YAHOO.widget.Button", "name": "_addListenersToForm", "url": "YAHOO.widget.Button.html#method__addListenersToForm", "type": "method"}, {"access": "", "host": "YAHOO.widget.Button", "name": "addStateCSSClasses", "url": "YAHOO.widget.Button.html#method_addStateCSSClasses", "type": "method"}, {"access": "", "host": "YAHOO.widget.ButtonGroup", "name": "beforeCheckedButtonChange", "url": "YAHOO.widget.ButtonGroup.html#event_beforeCheckedButtonChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.Button", "name": "beforeCheckedChange", "url": "YAHOO.widget.Button.html#event_beforeCheckedChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.Button", "name": "beforeContainerChange", "url": "YAHOO.widget.Button.html#event_beforeContainerChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.ButtonGroup", "name": "beforeContainerChange", "url": "YAHOO.widget.ButtonGroup.html#event_beforeContainerChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.Button", "name": "beforeDisabledChange", "url": "YAHOO.widget.Button.html#event_beforeDisabledChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.ButtonGroup", "name": "beforeDisabledChange", "url": "YAHOO.widget.ButtonGroup.html#event_beforeDisabledChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.Button", "name": "beforeFocusmenuChange", "url": "YAHOO.widget.Button.html#event_beforeFocusmenuChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.Button", "name": "beforeHrefChange", "url": "YAHOO.widget.Button.html#event_beforeHrefChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.Button", "name": "beforeLabelChange", "url": "YAHOO.widget.Button.html#event_beforeLabelChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.Button", "name": "beforeLazyloadmenuChange", "url": "YAHOO.widget.Button.html#event_beforeLazyloadmenuChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.Button", "name": "beforeMenualignmentChange", "url": "YAHOO.widget.Button.html#event_beforeMenualignmentChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.Button", "name": "beforeMenuChange", "url": "YAHOO.widget.Button.html#event_beforeMenuChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.Button", "name": "beforeMenuclassnameChange", "url": "YAHOO.widget.Button.html#event_beforeMenuclassnameChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.Button", "name": "beforeMenumaxheightChange", "url": "YAHOO.widget.Button.html#event_beforeMenumaxheightChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.Button", "name": "beforeMenuminscrollheightChange", "url": "YAHOO.widget.Button.html#event_beforeMenuminscrollheightChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.Button", "name": "beforeNameChange", "url": "YAHOO.widget.Button.html#event_beforeNameChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.ButtonGroup", "name": "beforeNameChange", "url": "YAHOO.widget.ButtonGroup.html#event_beforeNameChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.Button", "name": "beforeOnclickChange", "url": "YAHOO.widget.Button.html#event_beforeOnclickChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.Button", "name": "beforeReplaceLabelChange", "url": "YAHOO.widget.Button.html#event_beforeReplaceLabelChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.Button", "name": "beforeSelectedMenuItemChange", "url": "YAHOO.widget.Button.html#event_beforeSelectedMenuItemChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.Button", "name": "beforeSrcelementChange", "url": "YAHOO.widget.Button.html#event_beforeSrcelementChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.Button", "name": "beforeTabindexChange", "url": "YAHOO.widget.Button.html#event_beforeTabindexChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.Button", "name": "beforeTargetChange", "url": "YAHOO.widget.Button.html#event_beforeTargetChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.Button", "name": "beforeTitleChange", "url": "YAHOO.widget.Button.html#event_beforeTitleChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.Button", "name": "beforeTypeChange", "url": "YAHOO.widget.Button.html#event_beforeTypeChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.Button", "name": "beforeValueChange", "url": "YAHOO.widget.Button.html#event_beforeValueChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.ButtonGroup", "name": "beforeValueChange", "url": "YAHOO.widget.ButtonGroup.html#event_beforeValueChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.Button", "name": "blur", "url": "YAHOO.widget.Button.html#method_blur", "type": "method"}, {"access": "", "host": "YAHOO.widget.Button", "name": "blur", "url": "YAHOO.widget.Button.html#event_blur", "type": "event"}, {"access": "protected", "host": "YAHOO.widget.Button", "name": "_button", "url": "YAHOO.widget.Button.html#property__button", "type": "property"}, {"access": "protected", "host": "YAHOO.widget.ButtonGroup", "name": "_buttons", "url": "YAHOO.widget.ButtonGroup.html#property__buttons", "type": "property"}, {"access": "", "host": "YAHOO.widget.ButtonGroup", "name": "check", "url": "YAHOO.widget.ButtonGroup.html#method_check", "type": "method"}, {"access": "", "host": "YAHOO.widget.Button", "name": "CHECK_ACTIVATION_KEYS", "url": "YAHOO.widget.Button.html#property_CHECK_ACTIVATION_KEYS", "type": "property"}, {"access": "", "host": "YAHOO.widget.Button", "name": "checked", "url": "YAHOO.widget.Button.html#config_checked", "type": "config"}, {"access": "", "host": "YAHOO.widget.ButtonGroup", "name": "checkedButton", "url": "YAHOO.widget.ButtonGroup.html#config_checkedButton", "type": "config"}, {"access": "", "host": "YAHOO.widget.ButtonGroup", "name": "checkedButtonChange", "url": "YAHOO.widget.ButtonGroup.html#event_checkedButtonChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.Button", "name": "checkedChange", "url": "YAHOO.widget.Button.html#event_checkedChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.Button", "name": "CLASS_NAME_PREFIX", "url": "YAHOO.widget.Button.html#property_CLASS_NAME_PREFIX", "type": "property"}, {"access": "", "host": "YAHOO.widget.ButtonGroup", "name": "CLASS_NAME_PREFIX", "url": "YAHOO.widget.ButtonGroup.html#property_CLASS_NAME_PREFIX", "type": "property"}, {"access": "", "host": "YAHOO.widget.Button", "name": "container", "url": "YAHOO.widget.Button.html#config_container", "type": "config"}, {"access": "", "host": "YAHOO.widget.ButtonGroup", "name": "container", "url": "YAHOO.widget.ButtonGroup.html#config_container", "type": "config"}, {"access": "", "host": "YAHOO.widget.Button", "name": "containerChange", "url": "YAHOO.widget.Button.html#event_containerChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.ButtonGroup", "name": "containerChange", "url": "YAHOO.widget.ButtonGroup.html#event_containerChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.Button", "name": "createButtonElement", "url": "YAHOO.widget.Button.html#method_createButtonElement", "type": "method"}, {"access": "protected", "host": "YAHOO.widget.ButtonGroup", "name": "_createGroupElement", "url": "YAHOO.widget.ButtonGroup.html#method__createGroupElement", "type": "method"}, {"access": "", "host": "YAHOO.widget.Button", "name": "createHiddenFields", "url": "YAHOO.widget.Button.html#method_createHiddenFields", "type": "method"}, {"access": "private", "host": "YAHOO.widget.Button", "name": "createInputElement", "url": "YAHOO.widget.Button.html#method_createInputElement", "type": "method"}, {"access": "", "host": "YAHOO.widget.Button", "name": "CSS_CLASS_NAME", "url": "YAHOO.widget.Button.html#property_CSS_CLASS_NAME", "type": "property"}, {"access": "", "host": "YAHOO.widget.ButtonGroup", "name": "CSS_CLASS_NAME", "url": "YAHOO.widget.ButtonGroup.html#property_CSS_CLASS_NAME", "type": "property"}, {"access": "", "host": "YAHOO.widget.Button", "name": "destroy", "url": "YAHOO.widget.Button.html#method_destroy", "type": "method"}, {"access": "", "host": "YAHOO.widget.ButtonGroup", "name": "destroy", "url": "YAHOO.widget.ButtonGroup.html#method_destroy", "type": "method"}, {"access": "", "host": "YAHOO.widget.Button", "name": "disabled", "url": "YAHOO.widget.Button.html#config_disabled", "type": "config"}, {"access": "", "host": "YAHOO.widget.ButtonGroup", "name": "disabled", "url": "YAHOO.widget.ButtonGroup.html#config_disabled", "type": "config"}, {"access": "", "host": "YAHOO.widget.Button", "name": "disabledChange", "url": "YAHOO.widget.Button.html#event_disabledChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.ButtonGroup", "name": "disabledChange", "url": "YAHOO.widget.ButtonGroup.html#event_disabledChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.Button", "name": "focus", "url": "YAHOO.widget.Button.html#method_focus", "type": "method"}, {"access": "", "host": "YAHOO.widget.Button", "name": "focus", "url": "YAHOO.widget.Button.html#event_focus", "type": "event"}, {"access": "", "host": "YAHOO.widget.ButtonGroup", "name": "focus", "url": "YAHOO.widget.ButtonGroup.html#method_focus", "type": "method"}, {"access": "", "host": "YAHOO.widget.Button", "name": "focusmenu", "url": "YAHOO.widget.Button.html#config_focusmenu", "type": "config"}, {"access": "", "host": "YAHOO.widget.Button", "name": "focusmenuChange", "url": "YAHOO.widget.Button.html#event_focusmenuChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.ButtonGroup", "name": "getButton", "url": "YAHOO.widget.ButtonGroup.html#method_getButton", "type": "method"}, {"access": "", "host": "YAHOO.widget.ButtonGroup", "name": "getButtons", "url": "YAHOO.widget.ButtonGroup.html#method_getButtons", "type": "method"}, {"access": "", "host": "YAHOO.widget.ButtonGroup", "name": "getCount", "url": "YAHOO.widget.ButtonGroup.html#method_getCount", "type": "method"}, {"access": "", "host": "YAHOO.widget.Button", "name": "getForm", "url": "YAHOO.widget.Button.html#method_getForm", "type": "method"}, {"access": "", "host": "YAHOO.widget.Button", "name": "getHiddenFields", "url": "YAHOO.widget.Button.html#method_getHiddenFields", "type": "method"}, {"access": "", "host": "YAHOO.widget.Button", "name": "getMenu", "url": "YAHOO.widget.Button.html#method_getMenu", "type": "method"}, {"access": "", "host": "YAHOO.widget.Button", "name": "hasFocus", "url": "YAHOO.widget.Button.html#method_hasFocus", "type": "method"}, {"access": "protected", "host": "YAHOO.widget.Button", "name": "_hasKeyEventHandlers", "url": "YAHOO.widget.Button.html#property__hasKeyEventHandlers", "type": "property"}, {"access": "protected", "host": "YAHOO.widget.Button", "name": "_hasMouseEventHandlers", "url": "YAHOO.widget.Button.html#property__hasMouseEventHandlers", "type": "property"}, {"access": "protected", "host": "YAHOO.widget.Button", "name": "_hiddenFields", "url": "YAHOO.widget.Button.html#property__hiddenFields", "type": "property"}, {"access": "protected", "host": "YAHOO.widget.Button", "name": "_hideMenu", "url": "YAHOO.widget.Button.html#method__hideMenu", "type": "method"}, {"access": "", "host": "YAHOO.widget.Button", "name": "href", "url": "YAHOO.widget.Button.html#config_href", "type": "config"}, {"access": "", "host": "YAHOO.widget.Button", "name": "hrefChange", "url": "YAHOO.widget.Button.html#event_hrefChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.Button", "name": "init", "url": "YAHOO.widget.Button.html#method_init", "type": "method"}, {"access": "", "host": "YAHOO.widget.ButtonGroup", "name": "init", "url": "YAHOO.widget.ButtonGroup.html#method_init", "type": "method"}, {"access": "", "host": "YAHOO.widget.Button", "name": "initAttributes", "url": "YAHOO.widget.Button.html#method_initAttributes", "type": "method"}, {"access": "", "host": "YAHOO.widget.ButtonGroup", "name": "initAttributes", "url": "YAHOO.widget.ButtonGroup.html#method_initAttributes", "type": "method"}, {"access": "private", "host": "YAHOO.widget.Button", "name": "initConfig", "url": "YAHOO.widget.Button.html#method_initConfig", "type": "method"}, {"access": "protected", "host": "YAHOO.widget.Button", "name": "_isActivationKey", "url": "YAHOO.widget.Button.html#method__isActivationKey", "type": "method"}, {"access": "", "host": "YAHOO.widget.Button", "name": "isActive", "url": "YAHOO.widget.Button.html#method_isActive", "type": "method"}, {"access": "protected", "host": "YAHOO.widget.Button", "name": "_isSplitButtonOptionKey", "url": "YAHOO.widget.Button.html#method__isSplitButtonOptionKey", "type": "method"}, {"access": "", "host": "YAHOO.widget.Button", "name": "label", "url": "YAHOO.widget.Button.html#config_label", "type": "config"}, {"access": "", "host": "YAHOO.widget.Button", "name": "labelChange", "url": "YAHOO.widget.Button.html#event_labelChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.Button", "name": "lazyloadmenu", "url": "YAHOO.widget.Button.html#config_lazyloadmenu", "type": "config"}, {"access": "", "host": "YAHOO.widget.Button", "name": "lazyloadmenuChange", "url": "YAHOO.widget.Button.html#event_lazyloadmenuChange", "type": "event"}, {"access": "protected", "host": "YAHOO.widget.Button", "name": "_menu", "url": "YAHOO.widget.Button.html#property__menu", "type": "property"}, {"access": "", "host": "YAHOO.widget.Button", "name": "menu", "url": "YAHOO.widget.Button.html#config_menu", "type": "config"}, {"access": "", "host": "YAHOO.widget.Button", "name": "menualignment", "url": "YAHOO.widget.Button.html#config_menualignment", "type": "config"}, {"access": "", "host": "YAHOO.widget.Button", "name": "menualignmentChange", "url": "YAHOO.widget.Button.html#event_menualignmentChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.Button", "name": "menuChange", "url": "YAHOO.widget.Button.html#event_menuChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.Button", "name": "menuclassname", "url": "YAHOO.widget.Button.html#config_menuclassname", "type": "config"}, {"access": "", "host": "YAHOO.widget.Button", "name": "menuclassnameChange", "url": "YAHOO.widget.Button.html#event_menuclassnameChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.Button", "name": "menumaxheight", "url": "YAHOO.widget.Button.html#config_menumaxheight", "type": "config"}, {"access": "", "host": "YAHOO.widget.Button", "name": "menumaxheightChange", "url": "YAHOO.widget.Button.html#event_menumaxheightChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.Button", "name": "menuminscrollheight", "url": "YAHOO.widget.Button.html#config_menuminscrollheight", "type": "config"}, {"access": "", "host": "YAHOO.widget.Button", "name": "menuminscrollheightChange", "url": "YAHOO.widget.Button.html#event_menuminscrollheightChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.Button", "name": "name", "url": "YAHOO.widget.Button.html#config_name", "type": "config"}, {"access": "", "host": "YAHOO.widget.ButtonGroup", "name": "name", "url": "YAHOO.widget.ButtonGroup.html#config_name", "type": "config"}, {"access": "", "host": "YAHOO.widget.Button", "name": "nameChange", "url": "YAHOO.widget.Button.html#event_nameChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.ButtonGroup", "name": "nameChange", "url": "YAHOO.widget.ButtonGroup.html#event_nameChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.Button", "name": "NODE_NAME", "url": "YAHOO.widget.Button.html#property_NODE_NAME", "type": "property"}, {"access": "", "host": "YAHOO.widget.ButtonGroup", "name": "NODE_NAME", "url": "YAHOO.widget.ButtonGroup.html#property_NODE_NAME", "type": "property"}, {"access": "protected", "host": "YAHOO.widget.Button", "name": "_nOptionRegionX", "url": "YAHOO.widget.Button.html#property__nOptionRegionX", "type": "property"}, {"access": "protected", "host": "YAHOO.widget.Button", "name": "_onAppendTo", "url": "YAHOO.widget.Button.html#method__onAppendTo", "type": "method"}, {"access": "protected", "host": "YAHOO.widget.ButtonGroup", "name": "_onAppendTo", "url": "YAHOO.widget.ButtonGroup.html#method__onAppendTo", "type": "method"}, {"access": "protected", "host": "YAHOO.widget.Button", "name": "_onBlur", "url": "YAHOO.widget.Button.html#method__onBlur", "type": "method"}, {"access": "protected", "host": "YAHOO.widget.ButtonGroup", "name": "_onButtonCheckedChange", "url": "YAHOO.widget.ButtonGroup.html#method__onButtonCheckedChange", "type": "method"}, {"access": "protected", "host": "YAHOO.widget.Button", "name": "_onClick", "url": "YAHOO.widget.Button.html#method__onClick", "type": "method"}, {"access": "", "host": "YAHOO.widget.Button", "name": "onclick", "url": "YAHOO.widget.Button.html#config_onclick", "type": "config"}, {"access": "protected", "host": "YAHOO.widget.Button", "name": "_onclickAttributeValue", "url": "YAHOO.widget.Button.html#property__onclickAttributeValue", "type": "property"}, {"access": "", "host": "YAHOO.widget.Button", "name": "onclickChange", "url": "YAHOO.widget.Button.html#event_onclickChange", "type": "event"}, {"access": "protected", "host": "YAHOO.widget.Button", "name": "_onDblClick", "url": "YAHOO.widget.Button.html#method__onDblClick", "type": "method"}, {"access": "protected", "host": "YAHOO.widget.Button", "name": "_onDocumentKeyUp", "url": "YAHOO.widget.Button.html#method__onDocumentKeyUp", "type": "method"}, {"access": "protected", "host": "YAHOO.widget.Button", "name": "_onDocumentMouseDown", "url": "YAHOO.widget.Button.html#method__onDocumentMouseDown", "type": "method"}, {"access": "protected", "host": "YAHOO.widget.Button", "name": "_onDocumentMouseUp", "url": "YAHOO.widget.Button.html#method__onDocumentMouseUp", "type": "method"}, {"access": "protected", "host": "YAHOO.widget.Button", "name": "_onFocus", "url": "YAHOO.widget.Button.html#method__onFocus", "type": "method"}, {"access": "protected", "host": "YAHOO.widget.Button", "name": "_onFormReset", "url": "YAHOO.widget.Button.html#method__onFormReset", "type": "method"}, {"access": "protected", "host": "YAHOO.widget.Button", "name": "_onFormSubmit", "url": "YAHOO.widget.Button.html#method__onFormSubmit", "type": "method"}, {"access": "protected", "host": "YAHOO.widget.Button", "name": "_onKeyDown", "url": "YAHOO.widget.Button.html#method__onKeyDown", "type": "method"}, {"access": "protected", "host": "YAHOO.widget.ButtonGroup", "name": "_onKeyDown", "url": "YAHOO.widget.ButtonGroup.html#method__onKeyDown", "type": "method"}, {"access": "protected", "host": "YAHOO.widget.Button", "name": "_onKeyUp", "url": "YAHOO.widget.Button.html#method__onKeyUp", "type": "method"}, {"access": "", "host": "YAHOO.widget.Button", "name": "_onLabelClick", "url": "YAHOO.widget.Button.html#method__onLabelClick", "type": "method"}, {"access": "private", "host": "YAHOO.widget.Button", "name": "_onMenuClick", "url": "YAHOO.widget.Button.html#method__onMenuClick", "type": "method"}, {"access": "private", "host": "YAHOO.widget.Button", "name": "_onMenuHide", "url": "YAHOO.widget.Button.html#method__onMenuHide", "type": "method"}, {"access": "private", "host": "YAHOO.widget.Button", "name": "_onMenuKeyDown", "url": "YAHOO.widget.Button.html#method__onMenuKeyDown", "type": "method"}, {"access": "private", "host": "YAHOO.widget.Button", "name": "_onMenuRender", "url": "YAHOO.widget.Button.html#method__onMenuRender", "type": "method"}, {"access": "private", "host": "YAHOO.widget.Button", "name": "_onMenuShow", "url": "YAHOO.widget.Button.html#method__onMenuShow", "type": "method"}, {"access": "protected", "host": "YAHOO.widget.Button", "name": "_onMouseDown", "url": "YAHOO.widget.Button.html#method__onMouseDown", "type": "method"}, {"access": "protected", "host": "YAHOO.widget.Button", "name": "_onMouseMove", "url": "YAHOO.widget.Button.html#method__onMouseMove", "type": "method"}, {"access": "protected", "host": "YAHOO.widget.Button", "name": "_onMouseOut", "url": "YAHOO.widget.Button.html#method__onMouseOut", "type": "method"}, {"access": "protected", "host": "YAHOO.widget.Button", "name": "_onMouseOver", "url": "YAHOO.widget.Button.html#method__onMouseOver", "type": "method"}, {"access": "protected", "host": "YAHOO.widget.Button", "name": "_onMouseUp", "url": "YAHOO.widget.Button.html#method__onMouseUp", "type": "method"}, {"access": "protected", "host": "YAHOO.widget.Button", "name": "_onOption", "url": "YAHOO.widget.Button.html#method__onOption", "type": "method"}, {"access": "", "host": "YAHOO.widget.Button", "name": "_onSelectedMenuItemChange", "url": "YAHOO.widget.Button.html#method__onSelectedMenuItemChange", "type": "method"}, {"access": "", "host": "YAHOO.widget.Button", "name": "option", "url": "YAHOO.widget.Button.html#event_option", "type": "event"}, {"access": "", "host": "YAHOO.widget.Button", "name": "OPTION_AREA_WIDTH", "url": "YAHOO.widget.Button.html#property_OPTION_AREA_WIDTH", "type": "property"}, {"access": "", "host": "YAHOO.widget.ButtonGroup", "name": "removeButton", "url": "YAHOO.widget.ButtonGroup.html#method_removeButton", "type": "method"}, {"access": "", "host": "YAHOO.widget.Button", "name": "removeHiddenFields", "url": "YAHOO.widget.Button.html#method_removeHiddenFields", "type": "method"}, {"access": "", "host": "YAHOO.widget.Button", "name": "removeStateCSSClasses", "url": "YAHOO.widget.Button.html#method_removeStateCSSClasses", "type": "method"}, {"access": "", "host": "YAHOO.widget.Button", "name": "replaceLabel", "url": "YAHOO.widget.Button.html#config_replaceLabel", "type": "config"}, {"access": "", "host": "YAHOO.widget.Button", "name": "replaceLabelChange", "url": "YAHOO.widget.Button.html#event_replaceLabelChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.Button", "name": "selectedMenuItem", "url": "YAHOO.widget.Button.html#config_selectedMenuItem", "type": "config"}, {"access": "", "host": "YAHOO.widget.Button", "name": "selectedMenuItemChange", "url": "YAHOO.widget.Button.html#event_selectedMenuItemChange", "type": "event"}, {"access": "private", "host": "YAHOO.widget.Button", "name": "setAttributeFromDOMAttribute", "url": "YAHOO.widget.Button.html#method_setAttributeFromDOMAttribute", "type": "method"}, {"access": "private", "host": "YAHOO.widget.Button", "name": "setAttributesFromSrcElement", "url": "YAHOO.widget.Button.html#method_setAttributesFromSrcElement", "type": "method"}, {"access": "protected", "host": "YAHOO.widget.Button", "name": "_setChecked", "url": "YAHOO.widget.Button.html#method__setChecked", "type": "method"}, {"access": "protected", "host": "YAHOO.widget.Button", "name": "_setDisabled", "url": "YAHOO.widget.Button.html#method__setDisabled", "type": "method"}, {"access": "protected", "host": "YAHOO.widget.ButtonGroup", "name": "_setDisabled", "url": "YAHOO.widget.ButtonGroup.html#method__setDisabled", "type": "method"}, {"access": "private", "host": "YAHOO.widget.Button", "name": "setFormElementProperties", "url": "YAHOO.widget.Button.html#method_setFormElementProperties", "type": "method"}, {"access": "protected", "host": "YAHOO.widget.Button", "name": "_setHref", "url": "YAHOO.widget.Button.html#method__setHref", "type": "method"}, {"access": "protected", "host": "YAHOO.widget.Button", "name": "_setLabel", "url": "YAHOO.widget.Button.html#method__setLabel", "type": "method"}, {"access": "protected", "host": "YAHOO.widget.Button", "name": "_setMenu", "url": "YAHOO.widget.Button.html#method__setMenu", "type": "method"}, {"access": "protected", "host": "YAHOO.widget.Button", "name": "_setOnClick", "url": "YAHOO.widget.Button.html#method__setOnClick", "type": "method"}, {"access": "protected", "host": "YAHOO.widget.Button", "name": "_setTabIndex", "url": "YAHOO.widget.Button.html#method__setTabIndex", "type": "method"}, {"access": "protected", "host": "YAHOO.widget.Button", "name": "_setTarget", "url": "YAHOO.widget.Button.html#method__setTarget", "type": "method"}, {"access": "protected", "host": "YAHOO.widget.Button", "name": "_setTitle", "url": "YAHOO.widget.Button.html#method__setTitle", "type": "method"}, {"access": "protected", "host": "YAHOO.widget.Button", "name": "_setType", "url": "YAHOO.widget.Button.html#method__setType", "type": "method"}, {"access": "protected", "host": "YAHOO.widget.Button", "name": "_showMenu", "url": "YAHOO.widget.Button.html#method__showMenu", "type": "method"}, {"access": "", "host": "YAHOO.widget.Button", "name": "srcelement", "url": "YAHOO.widget.Button.html#config_srcelement", "type": "config"}, {"access": "", "host": "YAHOO.widget.Button", "name": "srcelementChange", "url": "YAHOO.widget.Button.html#event_srcelementChange", "type": "event"}, {"access": "protected", "host": "YAHOO.widget.Button", "name": "submitForm", "url": "YAHOO.widget.Button.html#method_submitForm", "type": "method"}, {"access": "", "host": "YAHOO.widget.Button", "name": "tabindex", "url": "YAHOO.widget.Button.html#config_tabindex", "type": "config"}, {"access": "", "host": "YAHOO.widget.Button", "name": "tabindexChange", "url": "YAHOO.widget.Button.html#event_tabindexChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.Button", "name": "target", "url": "YAHOO.widget.Button.html#config_target", "type": "config"}, {"access": "", "host": "YAHOO.widget.Button", "name": "targetChange", "url": "YAHOO.widget.Button.html#event_targetChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.Button", "name": "title", "url": "YAHOO.widget.Button.html#config_title", "type": "config"}, {"access": "", "host": "YAHOO.widget.Button", "name": "titleChange", "url": "YAHOO.widget.Button.html#event_titleChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.Button", "name": "toString", "url": "YAHOO.widget.Button.html#method_toString", "type": "method"}, {"access": "", "host": "YAHOO.widget.ButtonGroup", "name": "toString", "url": "YAHOO.widget.ButtonGroup.html#method_toString", "type": "method"}, {"access": "", "host": "YAHOO.widget.Button", "name": "type", "url": "YAHOO.widget.Button.html#config_type", "type": "config"}, {"access": "", "host": "YAHOO.widget.Button", "name": "typeChange", "url": "YAHOO.widget.Button.html#event_typeChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.Button", "name": "value", "url": "YAHOO.widget.Button.html#config_value", "type": "config"}, {"access": "", "host": "YAHOO.widget.ButtonGroup", "name": "value", "url": "YAHOO.widget.ButtonGroup.html#config_value", "type": "config"}, {"access": "", "host": "YAHOO.widget.Button", "name": "valueChange", "url": "YAHOO.widget.Button.html#event_valueChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.ButtonGroup", "name": "valueChange", "url": "YAHOO.widget.ButtonGroup.html#event_valueChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.Button", "name": "YAHOO.widget.Button.addHiddenFieldsToForm", "url": "YAHOO.widget.Button.html#method_YAHOO.widget.Button.addHiddenFieldsToForm", "type": "method"}, {"access": "", "host": "YAHOO.widget.Button", "name": "YAHOO.widget.Button.getButton", "url": "YAHOO.widget.Button.html#method_YAHOO.widget.Button.getButton", "type": "method"}, {"access": "", "host": "YAHOO.widget.Button", "name": "YAHOO.widget.Button.onFormKeyPress", "url": "YAHOO.widget.Button.html#method_YAHOO.widget.Button.onFormKeyPress", "type": "method"}];
</script>
</body>
</html>
